molgenis / data-transform-vkgl

GNU Lesser General Public License v3.0
0 stars 3 forks source link

When internet connection is lost and batch of variants is not returned from variant validator, no error is presented #35

Closed marikaris closed 3 years ago

marikaris commented 3 years ago

Run the service, turn internet off, turn it back on.

Expected: For variants that were lost in the process, we get an error in the errorlog

Observed: They are lost in a void of nothingness

dennishendriksen commented 3 years ago

Notes:

dennishendriksen commented 3 years ago

issue

data-transform-vkgl appears to complete succesfully (result files and error files are produced, no errors are logged) but data is missing

hypothesis

this is caused by the setting of a 'completionTimeout' (based on completion.timeout=60000 in application.properties):

from("direct:validate")
    .routeId("validateRoute")
    .process()
    .body(Map.class, refValidator::validateOriginalRef)
    .aggregate(header(FILE_NAME), new GroupedBodyAggregationStrategy())
    .completionTimeout(fileCompletionTimeout)
    .process(geneValidator::getVariantsWithCorrectGenes)
    .to("direct:check_unique");

completionTimeout JavaDoc

Time in millis that an aggregated exchange should be inactive before its complete (timeout).

what happens

The route is inactive for one minute because of a HTTP request (including retries) that takes longer than one minute to complete succesfully.

solution

a) do not completionTimeout but complete in a robust way that guarantees that all input files were processed https://camel.apache.org/components/latest/eips/aggregate-eip.html#_about_completion

b) make sure that completionTimeout is larger than the total expected inactivity time, for example:

connectionsPerRoute 1 maxTotalConnections 1 connectionRequestTimeout -1 connectTimeout 10000 socketTimeout 60000