Skip to content

fix: invalid fd during cleanup - #315

Merged
imor merged 1 commit into
masterfrom
rs/fix-cleanup-order
Oct 22, 2026
Merged

imor merged 1 commit into
masterfrom
rs/fix-cleanup-order

Conversation

@imor

@imor imor commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Documentation for libcurl at says the following about the multi socket callback function:

This callback may get invoked at any time when interacting with libcurl. This may even happen after all transfers are done and is likely to happen during a call to curl_multi_cleanup when cached connections are shut down.

Since the callback uses epfd in it, it must stay open until curl_multi_cleanup succeeds. This commit reorders the cleanup functions to ensure that.

@imor
imor added this pull request to stack #309 October 8, 2026 12:08
@imor
imor requested a review from a team as a code owner October 8, 2026 12:08

@steve-chavez steve-chavez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@imor
imor force-pushed the rs/fix-cleanup-order branch 2 times, most recently from bae1812 to f013a25 Compare October 11, 2026 11:26
@imor
imor force-pushed the rs/fix-cleanup-order branch from f013a25 to e9ebd4a Compare October 11, 2026 12:52
@imor
imor force-pushed the rs/fix-cleanup-order branch 6 times, most recently from 4d69c2f to ce46588 Compare October 13, 2026 08:20
Base automatically changed from rs/memory-barrier-fixes to master October 22, 2026 08:36
Documentation for libcurl at
https://curl.se/libcurl/c/CURLMOPT_SOCKETFUNCTION.html says the following about
the multi socket callback function

This callback may get invoked at any time when interacting with libcurl. This
may even happen after all transfers are done and is likely to happen during a
call to curl_multi_cleanup when cached connections are shut down.

Since the callback uses epfd in it, it must stay open until curl_multi_cleanup
succeeds. This commit reorders the cleanup functions to ensure that.
@imor
imor force-pushed the rs/fix-cleanup-order branch from ce46588 to b662fbd Compare October 22, 2026 08:36
@imor
imor merged commit 2b4efa3 into master Oct 22, 2026
17 checks passed
@imor
imor deleted the rs/fix-cleanup-order branch October 22, 2026 08:50
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.

3 participants