FrankChen021 commented on code in PR #20005:
URL: https://github.com/apache/druid/pull/20005#discussion_r3783668624
##########
indexing-service/src/main/java/org/apache/druid/indexing/common/actions/RemoteTaskActionClient.java:
##########
@@ -63,19 +63,17 @@ public <RetType> RetType submit(TaskAction<RetType>
taskAction) throws IOExcepti
// We're using a ServiceClient directly here instead of OverlordClient,
because OverlordClient does
// not have access to the TaskAction class. (OverlordClient is in the
druid-server package, and TaskAction
// is in the druid-indexing-service package.)
- final Map<String, Object> response = jsonMapper.readValue(
+ return jsonMapper.<TaskActionResponse<RetType>>readValue(
client.request(
new RequestBuilder(HttpMethod.POST, "/druid/indexer/v1/action")
.jsonContent(jsonMapper, new TaskActionHolder(task,
taskAction)),
- new BytesFullResponseHandler()
- ).getContent(),
- JacksonUtils.TYPE_REFERENCE_MAP_STRING_OBJECT
- );
-
- return jsonMapper.convertValue(
- response.get("result"),
- taskAction.getReturnTypeReference()
- );
+ new InputStreamResponseHandler()
Review Comment:
[P2] Streaming failures bypass ServiceClient retries
`InputStreamResponseHandler` completes the service future before the
response body has finished. If the body fails mid-stream, deserialization
receives an `IOException` after the future has already completed, so the
configured RPC retry policy is bypassed; the previous
`BytesFullResponseHandler` let `ServiceClient` retry these failures. Complete
the response only after the stream is fully consumed, or preserve the retryable
failure path.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]