fix(server): add connection_closed shared flag for HTTP streaming stop detection#23837
fix(server): add connection_closed shared flag for HTTP streaming stop detection#23837kripper wants to merge 1 commit into
Conversation
…p detection Replace should_stop reference with a shared_ptr<std::atomic<bool>> that is signaled by process_handler_response() on connection close, allowing pending streaming requests to detect client disconnection and stop gracefully.
|
I don't see how this solve the problem. A disconnected request now will keep going which defeats the whole point of allowing client to stop by disconnecting. The root cause comes from 2 different problem: timeout not handled properly and |
|
Thanks for the review.
|
|
There is something strange going on, and I'm still not sure whether this is a client-side timeout:
My interpretation is:
Thus, it seems the timeout is occurring:
|
Overview
Replace
should_stopreference with ashared_ptr<std::atomic<bool>>that is signaled byprocess_handler_response()on connection close, allowing pending streaming requests to detect client disconnection and stop gracefully.Additional information
Fixes:
Also mentioned here:
Requirements