mirror of https://github.com/apache/druid.git
fix query timeouts not being raised by broker
This commit is contained in:
parent
3699a41a54
commit
4dccfda61d
|
@ -159,15 +159,20 @@ public class DirectDruidClient<T> implements QueryRunner<T>
|
|||
byteCount += response.getContent().readableBytes();
|
||||
|
||||
try {
|
||||
final Map<String, Object> responseContext = objectMapper.readValue(
|
||||
response.headers().get("X-Druid-Response-Context"), new TypeReference<Map<String, Object>>()
|
||||
final String responseContext = response.headers().get("X-Druid-Response-Context");
|
||||
// context may be null in case of error or query timeout
|
||||
if (responseContext != null) {
|
||||
context.putAll(
|
||||
objectMapper.<Map<String, Object>>readValue(
|
||||
responseContext, new TypeReference<Map<String, Object>>()
|
||||
{
|
||||
}
|
||||
)
|
||||
);
|
||||
context.putAll(responseContext);
|
||||
}
|
||||
}
|
||||
catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
log.error(e, "Unable to parse response context from url[%s]", url);
|
||||
}
|
||||
|
||||
return super.handleResponse(response);
|
||||
|
|
Loading…
Reference in New Issue