Skip to content

Commit

Permalink
MSQ WorkerResource: Fix timeout handler for httpGetChannelData. (#17328)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gianm authored Oct 11, 2024
1 parent 034bb9d commit a0c29f8
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 a0c29f8

Please sign in to comment.