Make client smarter about Spring server state#756
Merged
Conversation
Member
|
Tests are failing with a timeout. Can you take a look? |
b435b15 to
e9f5140
Compare
Add the ability for a second Spring client to connect to the server socket while the first client is still preloading the app, by retrying with an increased timeout when that situation is detected. Also handle the case where we have a PID file, but no corresponding server socket.
e9f5140 to
c8b3fce
Compare
Contributor
Author
@rafaelfranca should be good now, the new tests had some leakage. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This covers two ways a client can find an existing Spring socket but still fail the initial version handshake:
timeout: Spring.boot_timeout.Before this, both could surface as “Error connecting to Spring server” even though the right behavior is recoverable: wait a little longer for the live booting server, or restart when the old server is gone.
The retry is still bounded. If the
pidfilelock says a server is alive, a client that did not boot it gets oneboot_timeout-sized wait for the greeting. If this client already booted the server, or the extra wait still does not produce a greeting, we keep failing/restarting instead of looping forever.I added acceptance coverage with real Spring processes for both cases, including a probe that proves the second client actually took the boot-timeout path.