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

Don't cache the socket-IO while connection setup #444

Merged
merged 1 commit into from Mar 9, 2022
Merged

Conversation

larskanis
Copy link
Collaborator

The file_no of the socket IO can change while connecting. This can happen when alternative hosts are tried,
while GSS authentication and when falling back to unencrypted in sslmode:prefer . Therefore expire the socket IO at each connect_poll and reset_poll call.

Caching the IO previosly led to occasional errors kind of:
Errno::EBADF: Bad file descriptor

@larskanis larskanis force-pushed the add-ssl branch 2 times, most recently from b88d59b to 8294c14 Compare March 9, 2022 18:35
The file_no of the socket IO can change while connecting.
This can happen when alternative hosts are tried,
while GSS authentication
and when falling back to unencrypted in sslmode:prefer .
Therefore expire the socket IO at each connect_poll and reset_poll call.

Caching the IO previosly led to occasional errors kind of:
  Errno::EBADF: Bad file descriptor

With the recreation of an IO object per connect_poll the fileno can change in the TcpGateScheduler when running on Windows.
I didn't dig deeper why this happens, but it fails in spec
  "with a Fiber scheduler connects several times concurrently"
and sometimes in other specs.
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.

None yet

1 participant