vespa-engine/vespa

Let Vespa HTTP client exit with non-zero return code on parsing errors

Chiusa

#10.842 aperta il 2 ott 2019

 (10 commenti) (0 reazioni) (0 assegnatari)Java (561 fork)batch import
enhancementgood first issue

Metriche repository

Star
 (4948 stelle)
Metriche merge PR
 (Merge medio 1g 22h) (209 PR mergiate in 30 g)

Descrizione

As reported by @rafan, the Vespa HTTP client will, by design, return with a standard zero return code even if the data fed har parsing errors:

Tue Oct 01 12:21:23 UTC 2019 Result received: 0 (0 failed so far, 1 sent, success rate 0.00 docs/sec).
Failure: Result for 'id:docker.ouroath.com:image::foobar
1569932482487 Trace starting 
1569932483817 Asked about retrying for cluster ID 0, number of retries is 1 Detail:
Detail resultType=FATAL_ERROR exception='No field 'foobar' in the structure of type 'image'' endpoint=someendpoint:443 ssl=true resultTimeLocally=1569932483817
1569932483835 Got detail: Detail resultType=FATAL_ERROR exception='No field 'foobar' in the structure of type 'image'' endpoint=someendpoint:443 ssl=true resultTimeLocally=1569932483817

:
    Detail resultType=FATAL_ERROR exception='No field 'foobar' in the structure of type 'image'' endpoint=someendpoint:443 ssl=true resultTimeLocally=1569932483817

Tue Oct 01 12:21:24 UTC 2019 Result received: 1 (1 failed so far, 1 sent, success rate 0.00 docs/sec).
$ echo $?
0

While this default behavior shouldn't change, we should add an optional command line parameter that would make vespa-http-client exit with a non-zero return code upon parsing errors.

Guida contributor