apple / swift-nio-http2

HTTP/2 support for SwiftNIO
https://swiftpackageindex.com/apple/swift-nio-http2/main/documentation/niohttp2
Apache License 2.0
462 stars 82 forks source link

Better handle writes issued with already completed promises #372

Closed glbrntt closed 1 year ago

glbrntt commented 1 year ago

Motivation:

The stream channel updates its writability manager when issuing a write to the parent channel and when the write promise has been succeeded. If the write promise has already been succeeded then the writability manager can be updated in the wrong order which can lead to underflow.

Modifications:

Result:

The writability manager's pending bytes shouldn't underflow.