Skip to content

pool: fix pool.Connect if a server i/o hangs #444

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 2 commits into from
Apr 14, 2025

Conversation

oleg-jukovec
Copy link
Collaborator

@oleg-jukovec oleg-jukovec commented Apr 13, 2025

Previously, pool.Connect attempted to establish a connection one after another instance. It could cause the entire chain to hang if one connection hanged. Now connections are established in parallel. After the first successful connection, the remaining connections wait with a timeout of pool.Opts.CheckTimeout.

I didn't forget about (remove if it is not applicable):

Related issues:

Closes #TNTP-2018

@oleg-jukovec oleg-jukovec force-pushed the oleg-jukovec/tntp-2018-pool-connect-parallel branch 2 times, most recently from 0c11b09 to ada08b4 Compare April 13, 2025 21:36
The tests flaks sometime with the error:

```
failed to identify: read error: context deadline exceeded
```

It was decided just to increase a connect timeout.
@oleg-jukovec oleg-jukovec force-pushed the oleg-jukovec/tntp-2018-pool-connect-parallel branch from 31218d0 to 0d4f6a2 Compare April 14, 2025 08:03
Previously, `pool.Connect` attempted to establish a connection one
after another instance. It could cause the entire chain to hang if one
connection hanged. Now connections are established in parallel. After
the first successful connection, the remaining connections wait with
a timeout of `pool.Opts.CheckTimeout`.

Closes #TNTP-2018
@oleg-jukovec oleg-jukovec force-pushed the oleg-jukovec/tntp-2018-pool-connect-parallel branch from 0d4f6a2 to 6a0c2df Compare April 14, 2025 08:04
@oleg-jukovec oleg-jukovec merged commit e85e137 into master Apr 14, 2025
26 checks passed
@oleg-jukovec oleg-jukovec deleted the oleg-jukovec/tntp-2018-pool-connect-parallel branch April 14, 2025 08:28
@oleg-jukovec oleg-jukovec mentioned this pull request Apr 14, 2025
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.

3 participants