MSQ WorkerResource: Fix timeout handler for httpGetChannelData. (#17328) (#17330)

The timeout handler should fire if the response has not been handled yet
(i.e. if responseResolved was previously false). However, it erroneously
fires only if the response *was* handled. This causes HTTP 500 errors if
the timeout actually does fire. The timeout is 30 seconds, which can be
hit during pipelined queries, if an earlier stage of the query hasn't
produced its first frame within 30 seconds.

This fixes a regression introduced in #17140.

Co-authored-by: Gian Merlino <gianmerlino@gmail.com>
This commit is contained in:
Abhishek Agarwal 2024-10-11 18:31:01 +05:30 committed by GitHub
parent 1a7f91f0ab
commit 2b98facdc4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 5 deletions

View File

@ -120,12 +120,10 @@ public class WorkerResource
public void onTimeout(AsyncEvent event)
{
if (responseResolved.compareAndSet(false, true)) {
return;
HttpServletResponse response = (HttpServletResponse) asyncContext.getResponse();
response.setStatus(HttpServletResponse.SC_OK);
event.getAsyncContext().complete();
}
HttpServletResponse response = (HttpServletResponse) asyncContext.getResponse();
response.setStatus(HttpServletResponse.SC_OK);
event.getAsyncContext().complete();
}
@Override