Repository navigation
Conversation
The finalizer called `close(ssl)`, which sends the close_notify, a socket write. A write that has to wait for the socket switches tasks, which a finalizer may not do: on nightly, where the socket write path waits more readily, `NoCloseStream` printed "task switch not allowed from inside gc finalizer". Older versions only wait when the socket buffer is full, so the hazard was latent. The finalizer now calls `close(ssl, false)`: the SSL object is freed and the socket closed, nothing is written. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #89 +/- ##
==========================================
- Coverage 77.56% 77.39% -0.17%
==========================================
Files 2 2
Lines 1083 1190 +107
==========================================
+ Hits 840 921 +81
- Misses 243 269 +26 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Oct 16, 2026
krynju
marked this pull request as draft
October 16, 2026 10:16
krynju
marked this pull request as ready for review
October 16, 2026 10:58
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. The finalizer calls
close(ssl), which sends the close_notify, a socket write. A write that has to wait for the socket switches tasks, which a finalizer may not do. On nightly, where the socket write path waits more readily,NoCloseStreamprinted "task switch not allowed from inside gc finalizer"; on released Julia it only waits when the socket buffer is full, so the hazard is latent.Fix. The finalizer calls
close(ssl, false): the SSL object is freed and the socket closed, nothing is written. A stream the user wants shut down cleanly still gets its close_notify from an explicitclose(ssl).No test:
NoCloseStreamis the existing coverage, and the failure depends on GC timing. No version bump; the fixes can be released together.🤖 Generated with Claude Code