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

connection: Fix race condition when socket closes after timeout #1048

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

sonnyp
Copy link
Member

@sonnyp sonnyp commented Jan 8, 2025

Fixes #956

Comment on lines -204 to +224
} catch {}
} catch (err) {
this.#onSocketClosed(true, err);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the actual fix #onSocketClosed will call _detachSocket which will prevent the disconnect status from being fired if the socket close after a timeout error.

@sonnyp sonnyp merged commit fb5ed94 into main Jan 8, 2025
3 checks passed
@sonnyp sonnyp deleted the fix-956 branch January 8, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Calling 'stop()' sometimes leads to the client being 'disconnected'
1 participant