Repository navigation
Conversation
This was referenced Oct 16, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #87 +/- ##
==========================================
+ Coverage 77.56% 78.79% +1.23%
==========================================
Files 2 2
Lines 1083 1193 +110
==========================================
+ Hits 840 940 +100
- Misses 243 253 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
krynju
marked this pull request as draft
October 16, 2026 10:16
When the peer closes mid-record, `SSL_peek_ex` keeps returning WANT_READ, `haspending` stays true for the partial record, and `eof(ssl.io)` returns true at once, so `eof` looped without ever yielding, starving every other task on the thread. Return true there: the bytes that would complete the record are never coming. One more round is allowed first: a concurrent read waiting on the socket ahead of this task may have taken the rest of the record while this task waited, in which case `bytesavailable` shows the decrypted bytes and `eof` is false. Adds `TruncatedRecordEOF`, which sends a partial record header and closes the socket cleanly. Without the fix it spins instead of failing. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
krynju
force-pushed
the
kr/eof-truncated-record
branch
from
October 16, 2026 10:50
3e2a2e6 to
0e75202
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out of #73, as asked in the review there: an independent fix, against
main.Bug. When the peer closes mid-record,
SSL_peek_exkeeps returning WANT_READ,haspendingstays true for the partial record, andeof(ssl.io)returns true at once.eofthen loops without ever yielding, which starves every other task on the thread; on one thread the process hangs.Fix. In the WANT_READ branch of
eof, return true when the socket is at EOF: the bytes that would complete the record are never coming, so this is the end of the stream. One more round is allowed first (review finding): a concurrentunsafe_readwaiting on the socket ahead of this task can take the rest of the record whileeofwaits, in which casebytesavailableshows the decrypted bytes on the next round andeofis false.Test.
TruncatedRecordEOFsends a record header announcing 100 bytes followed by 3 of them, then closes the socket with a FIN (a reader task keeps the client socket drained of the server's session tickets, so the close is not a RST). Onmainthe test spins until the job timeout instead of failing.The test file gains the same three helpers as #86 (self-signed server context, handshake loop, connected pair), in the same place, so whichever lands later only has to re-append its testset.
No version bump; the fixes can be released together.
🤖 Generated with Claude Code