Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close Multi timers atexit. Add 1.6 CI #234

Merged
merged 15 commits into from
Jan 13, 2024
Merged

Close Multi timers atexit. Add 1.6 CI #234

merged 15 commits into from
Jan 13, 2024

Conversation

IanButterworth
Copy link
Member

Fixes #223

Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should only be one function registered, since you cannot deregister them, this PR otherwise would create a memory leak

Copy link

codecov bot commented Jan 11, 2024

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (8a614d5) 90.62% compared to head (ab79e25) 89.70%.

Files Patch % Lines
src/Curl/Multi.jl 14.28% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #234      +/-   ##
==========================================
- Coverage   90.62%   89.70%   -0.92%     
==========================================
  Files           5        5              
  Lines         576      583       +7     
==========================================
+ Hits          522      523       +1     
- Misses         54       60       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/Curl/Multi.jl Outdated Show resolved Hide resolved
src/Curl/Multi.jl Outdated Show resolved Hide resolved
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there already a global list of these elsewhere

@StefanKarpinski
Copy link
Member

Not that I'm aware of, no.

@vtjnash
Copy link
Member

vtjnash commented Jan 11, 2024

How does it reuse connections then if there is no list of the
? If you just close the Timer, it seems it might hang for ~forever instead of having the timer close the connection after 30 seconds?

@IanButterworth
Copy link
Member Author

Should atexit instead call done!(multi)? Is there a global list of multi's already?

@IanButterworth
Copy link
Member Author

The Multi constructor already calls done! on multi at the finalizer.

finalizer(done!, multi)

I guess the finalizer isn't being called before the trailing task warning?

@StefanKarpinski
Copy link
Member

How does it reuse connections then if there is no list of the

Connections are only reused within a Downloader object; there's a single global default Downloader object. But if someone creates a new one of those locally, we don't have any global reference to it.

@vtjnash
Copy link
Member

vtjnash commented Jan 12, 2024

Ah, it sounds like there may need to be a global weakref list of active Downloader objects then?

@IanButterworth
Copy link
Member Author

I see no warning with this locally now.

@StefanKarpinski
Copy link
Member

StefanKarpinski commented Jan 12, 2024

Ah, it sounds like there may need to be a global weakref list of active Downloader objects then?

Yes, I think that Ian was trying to do this with a global (non-weak) list of timers to close. You think that doing a global weakref list of downloaders is a better approach? That always feels like such a failure of the programming language...

src/Curl/Multi.jl Outdated Show resolved Hide resolved
src/Curl/Multi.jl Outdated Show resolved Hide resolved
@IanButterworth IanButterworth changed the title Close timers atexit Close Multi timers atexit. Add 1.6 CI Jan 12, 2024
src/Curl/Multi.jl Outdated Show resolved Hide resolved
@IanButterworth
Copy link
Member Author

@vtjnash I just noticed that on 1.10.0 this doesn't avoid the IO warnings, but it does on master. Has when atexit and the IO check changed on 1.10 vs. master?

@IanButterworth
Copy link
Member Author

IanButterworth commented Jan 12, 2024

Ah JuliaLang/julia#51849 so this isn't a fix for 1.10

Indeed, CI shows the warning on 1.10

@IanButterworth
Copy link
Member Author

@StefanKarpinski I guess it is actually worth dropping 1.3 because of these windows CI issues?

@StefanKarpinski
Copy link
Member

Sure, go ahead and drop it. Not worth the effort anymore.

@IanButterworth
Copy link
Member Author

Should be ready now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using Downloads.download during precompilation of a package waits a long time for "IO to finish"
3 participants