Skip to content

session stops background loop on exit/close #1146

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

Merged
merged 1 commit into from
May 27, 2025

Conversation

ischneider
Copy link
Member

@ischneider ischneider commented May 21, 2025

I was unable to cleanly close the event loop and, therefore, the background thread.

One issue is that the sync API doesn't have any explicit resource cleanup hook.

I attempted to override __del__ for the Session as a means to cleanup and while this "worked" (tests all pass without -Werror)... When run w/ -Werror, it seems like a socket gets garbage collected before close is called and this triggers a warning that fails the test due to -Werror (convert warnings to errors)

Copy link
Contributor

@asonnenschein asonnenschein left a comment

Choose a reason for hiding this comment

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

LGTM!

@ischneider ischneider force-pushed the session-closes-background-loop branch 3 times, most recently from 6efb939 to 52808a3 Compare May 22, 2025 21:35
@ischneider ischneider force-pushed the session-closes-background-loop branch from 52808a3 to b06dd43 Compare May 27, 2025 21:51
@ischneider ischneider force-pushed the session-closes-background-loop branch from b06dd43 to 7030927 Compare May 27, 2025 22:23
@ischneider ischneider merged commit 263fbf6 into main May 27, 2025
9 checks passed
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.

2 participants