Closed niceskylei closed 5 months ago
Hm, good point, it seems that if a call to write()
returns 0, that implies the socket has been closed. A similar looking patch in a pull request would be welcome. The part to discuss is how to signal to the user that not all bytes were written. Perhaps returning a WriteZero
io error?
Description:
I'm experiencing an issue with the h2 crate where the CPU usage reaches 100% under specific conditions. This issue is consistently reproducible and significantly affects the performance of my application.
Steps to Reproduce:
Expected Behavior:
The CPU usage should remain within normal operating limits and not spike to 100% when the remote client disconnects.
Actual Behavior:
When the remote client disconnects, the CPU usage spikes to 100% and remains there, causing severe performance degradation.
Environment:
Additional Context:
use instruments analyse cpu usage
Log Files/Output:
using trace log level, repeatedly print below log: queued_data_frame=false
How fix it:
I have applied a preliminary fix which seems to mitigate the issue, as the high CPU usage has not reoccurred during my initial tests. However, this fix has not been fully validated, and I am unsure if there are any other side effects or impacts.