Repository navigation
Fix keep-alive race when creating HttpServerOperations - #4189
Conversation
|
Thanks for the feedback. Based on your review comments, I reworked the fix to address the keep-alive handoff race directly instead of caching My understanding of the root cause is that there is a TOCTOU window between selecting the parent with The revised approach is:
Key design choices:
Does this direction look closer to what you had in mind before I update the PR? |
83aa9dd to
381e6a9
Compare
|
@violetagg I pushed an updated version of the branch based on the previous feedback. |
381e6a9 to
4a953e4
Compare
|
Can you add "Signed-off-by:" to the commit so that DCO check can pass? |
4a953e4 to
cc8bd92
Compare
Sure, I've added the sign-off and updated the commit. Thanks. |
|
@violetagg Thank you for the thoughtful review! I've addressed all the comments and updated the PR accordingly. Please let me know if there's anything else I should adjust. |
Delay keep-alive request handoff until previous ops terminates. Buffer incoming requests via doPipeline() when existing ops are still channel-bound, and resume read processing on HttpServerOperationsTerminatedEvent fired from afterInboundComplete() during terminate(). Fixes reactor#4188 Signed-off-by: kyuhee <koisyu@gmail.com>
cc8bd92 to
18f5a1b
Compare
keep-alive race when creating HttpServerOperations
Signed-off-by: Violeta Georgieva <696661+violetagg@users.noreply.github.com>


Summary
Fixes #4188
HttpTrafficHandlercreated newHttpServerOperationsfromConnection.from(ctx.channel()). On HTTP/1.1 keep-aliveconnections, that lookup could still return the previous request's
HttpServerOperationsinstead of the stable channel-bound connection.
This change captures the stable connection once in
handlerAdded()and reuses it for subsequent request-scopedHttpServerOperations, including the pipelined path. That prevents a new request from inheriting a terminatingChannelOperationsas its parent.Changes
HttpTrafficHandler.handlerAdded()HttpServerOperationsinchannelRead()run()Testing
testKeepAliveNewOpsUsesStableParentConnection