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

Report EOFError: TRILOGY_CLOSED_CONNECTION for SSL_ERROR_ZERO_RETURN #128

Merged
merged 1 commit into from
Oct 21, 2023

Conversation

jhawthorn
Copy link
Member

Fixes #125

If a server closes the SSL connection cleanly (SSL_shutdown) as we attempt a read or write (ie. a clean SSL shutdown but dirty MySQL shutdown) we will get SSL_ERROR_ZERO_RETURN as the return code.

Previously we would have reported this as:

Trilogy::SSLError: trilogy_query_recv: SSL Error: (null)

Now it will be reported as:

Trilogy::EOFError: trilogy_query_recv: TRILOGY_CLOSED_CONNECTION

On older versions (< 2.5.0) we may also have been reporting this as TRILOGY_CLOSED_CONNECTION.

If a server closes the SSL connection cleanly (SSL_shutdown) as we
attempt a read or write (ie. a clean SSL shutdown but dirty MySQL
shutdown) we will get SSL_ERROR_ZERO_RETURN as the return code.

Previously we would have reported this as:

    Trilogy::SSLError: trilogy_query_recv: SSL Error: (null)

Now it will be reported as:

    Trilogy::EOFError: trilogy_query_recv: TRILOGY_CLOSED_CONNECTION

On older versions (< 2.5.0) we may also have reported this as
TRILOGY_CLOSED_CONNECTION.

Co-authored-by: Brendan Dougherty <b.w.dougherty@gmail.com>
@jhawthorn jhawthorn merged commit 1d78d7b into trilogy-libraries:main Oct 21, 2023
12 checks passed
@dbussink
Copy link
Contributor

@jhawthorn Could I tempt you to release a new version with this fix included?

@jhawthorn
Copy link
Member Author

@jhawthorn Could I tempt you to release a new version with this fix included?

Done in 2.6.1

@jhawthorn jhawthorn deleted the ssl-zero-return branch January 4, 2024 22:49
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.

Trilogy::SSLError is raised when a vitess vtgate is shut down
3 participants