CelestiaTheDryad commented on PR #516: URL: https://github.com/apache/httpcomponents-core/pull/516#issuecomment-2685929413
All that actually needs to by synchronized is between `ioSession.setEvent(EventMask.WRITE)` and `responseState = MessageState.COMPLETE` which shouldn't cause any long term blocking. Or these operations could be reordered then no synchronization is needed. I couldn't see an easy path to these solutions so I made the minimal change I could. I question why the application thread is doing this work at all though. The general design of this library seems to treat each connection as a single threaded environment. With that in mind, it seems like the application thread should simply give the response producer to the stream handler, then set the IO flag and have the IO thread do all the writing and state management. That would remove this issue entirely. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org