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

Fix false positive unexpected connection close #303

Merged
merged 1 commit into from
Feb 18, 2025
Merged

Conversation

jchrys
Copy link
Collaborator

@jchrys jchrys commented Feb 17, 2025

Motivation:
The connection could be incorrectly detected as unexpectedly closed due to a race condition where the exit message was sent before updating the state to ST_CLOSING.

Modifications:
Ensured state update to ST_CLOSING happens before sending the exit message.

Result:
State update to ST_CLOSING happens before sending the exit message, preventing false positive unexpected close detections.
resolves #275

Motivation:
The connection could be incorrectly detected as
unexpectedly closed due to a race condition where the exit message was
sent before updating the state to `ST_CLOSING`.

Modifications:
Ensured state update to `ST_CLOSING` happens before
sending the exit message.

Result:
State update to `ST_CLOSING` happens before sending the exit
message, preventing false positive unexpected close detections.
resolves #275
@jchrys
Copy link
Collaborator Author

jchrys commented Feb 17, 2025

@JohnNiang
Could you kindly review this PR to resolve #275?
I believe we should keep the unexpected closing warning since the MySQL server might close the connection(e.g., idle_wait_timeout), and the client should be aware of that.

@jchrys jchrys marked this pull request as draft February 17, 2025 10:46
@jchrys jchrys added the bug Something isn't working label Feb 17, 2025
@jchrys jchrys marked this pull request as ready for review February 17, 2025 11:04
@jchrys jchrys marked this pull request as draft February 17, 2025 11:12
Copy link
Contributor

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

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

It works very well for me.

@jchrys jchrys marked this pull request as ready for review February 18, 2025 11:48
@jchrys jchrys merged commit badb3e5 into trunk Feb 18, 2025
28 checks passed
@jchrys jchrys deleted the unexpected-close branch February 18, 2025 12:30
@JohnNiang
Copy link
Contributor

Hi @jchrys , could we release a new version against this fix? ❤️

@jchrys
Copy link
Collaborator Author

jchrys commented Feb 19, 2025

@JohnNiang
NP, I was planning to release 1.4.0 this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] Connection unexpectedly closed
2 participants