Add GC-safe regions around ssl_read and ssl_write#265
Merged
Conversation
4c90bee to
34be0ef
Compare
Codecov Report
@@ Coverage Diff @@
## master #265 +/- ##
==========================================
+ Coverage 73.49% 73.86% +0.36%
==========================================
Files 12 12
Lines 732 750 +18
==========================================
+ Hits 538 554 +16
- Misses 194 196 +2
|
vtjnash
reviewed
Nov 2, 2023
34be0ef to
82eabdc
Compare
82eabdc to
9d9a5a5
Compare
Member
Author
|
The CI failures for Julia nightly are: They're coming from |
Member
|
There are so many random |
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.
We've observed
mbedtls_ssl_readandmbedtls_ssl_writeshow up in CPU profiles while also seeing long GC time-to-safepoint. Theseccalls call back into Julia (f_sendandf_recv), during which GC should be able to run. But I can't tell if, for large enough reads or writes, there could be a long interval without reaching a GC safepoint.Adding GC-safe regions around the
ccalls will let GC run even if a thread is busy inside. Sincec_sendandc_recvare@cfunctions, they will do the right thing wrt GC safety.Ref: JuliaLang/julia#51574
This is a temporary fix; when JuliaLang/julia#49933 lands, this should be changed to do whatever that requires.
If a reviewer knows for certain that a thread won't remain inside the
ccallwithout calling back into Julia for multiple seconds, then this PR can be discarded.