[
https://issues.apache.org/jira/browse/BEAM-5725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16668334#comment-16668334
]
Tim Robertson commented on BEAM-5725:
-------------------------------------
Copying from the user@ mailing list:
I took a super quick look at the code:.
# On a retry scenario it calls handleRetry()
# Within handleRetry() it gets the DefaultRetryPredicate and calls
test(response) - this reads the response stream to JSON
# When the retry is successful (no 429 code) the response is returned
# The response is then passed in to checkForErrors(...)
# This then tried to parse the response by reading the response stream. It was
already read in step 2 hence the stream cannot be read again
[~wouts] - this is something we also would like to see addressed. 2.9.0 will be
cut in 3 weeks - shall we aim for that?
Are you still keen to fix it, or would you like us to look? (CC [~aalbatross]
for info too).
> ElasticsearchIO RetryConfiguration response parse failure
> ---------------------------------------------------------
>
> Key: BEAM-5725
> URL: https://issues.apache.org/jira/browse/BEAM-5725
> Project: Beam
> Issue Type: Bug
> Components: io-java-elasticsearch
> Reporter: Wout Scheepers
> Assignee: Wout Scheepers
> Priority: Major
>
> When using .withRetryConfiguration() for ElasticsearchIO, I get the following
> stacktrace:
>
>
> {code:java}
> Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: No
> content to map due to end-of-input
> at [Source: (org.apache.http.nio.entity.ContentInputStream); line: 1, column:
> 0]
> at
> com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)
> at
> com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4133)
> at
> com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3988)
> at
> com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3058)
> at
> org.apache.beam.sdk.io.elasticsearch.ElasticsearchIO.parseResponse(ElasticsearchIO.java:173)
> at
> org.apache.beam.sdk.io.elasticsearch.ElasticsearchIO.checkForErrors(ElasticsearchIO.java:177)
> at
> org.apache.beam.sdk.io.elasticsearch.ElasticsearchIO$Write$WriteFn.flushBatch(ElasticsearchIO.java:1204)
> at
> org.apache.beam.sdk.io.elasticsearch.ElasticsearchIO$Write$WriteFn.finishBundle(ElasticsearchIO.java:1175)
> {code}
>
>
> Probably the elastic response object's content stream is consumed twice,
> resulting in a MismatchedInputException.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)