Skip to content

Commit

Permalink
MSQ WorkerResource: Fix timeout handler for httpGetChannelData. (#17328
Browse files Browse the repository at this point in the history
…) (#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 <[email protected]>
  • Loading branch information
abhishekagarwal87 and gianm authored Oct 11, 2024
1 parent 1a7f91f commit 2b98fac
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,10 @@ public void onComplete(AsyncEvent event)
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
Expand Down

0 comments on commit 2b98fac

Please sign in to comment.