Skip to content

Commit

Permalink
Ensure that the request handler are invoked on a duplication context,…
Browse files Browse the repository at this point in the history
… even when receiving pipelined requests. This is a 'temporary(tm)' workaround, as the issue most probably lies in Vert.x. It fixes quarkusio#24626
  • Loading branch information
cescoffier committed Apr 1, 2022
1 parent 533bfff commit fc801a2
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,22 @@ public void handle(HttpServerRequest event) {
root = new Handler<HttpServerRequest>() {
@Override
public void handle(HttpServerRequest event) {
setCurrentContextSafe(true);
delegate.handle(new ResumingRequestWrapper(event));
if (!VertxContext.isOnDuplicatedContext()) {
// Vert.x should call us on a duplicated context.
// But in the case of pipelined requests, it does not.
// See https://github.com/quarkusio/quarkus/issues/24626.
Context context = VertxContext.createNewDuplicatedContext();
context.runOnContext(new Handler<Void>() {
@Override
public void handle(Void x) {
setCurrentContextSafe(true);
delegate.handle(new ResumingRequestWrapper(event));
}
});
} else {
setCurrentContextSafe(true);
delegate.handle(new ResumingRequestWrapper(event));
}
}
};
if (httpConfiguration.recordRequestStartTime) {
Expand Down

0 comments on commit fc801a2

Please sign in to comment.