-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client: retry version negotiation after error
When a client is configured for API version negotiation, it would try exactly once to ping the server, then unconditionally configure the client API version and set the negotiated flag. Any failure to ping the server would result in the client "negotiating" the fallback API version v1.24, even if the request never reached the daemon. Transient network issues or simply calling a client method with an already-canceled context would be sufficient to cause this to happen. Modify the client's negotiation process to retry negotiation on each subsequent request until it receives a ping response from the daemon. Only responses with HTTP status codes in the range [1, 500] are considered to be ping responses from the daemon as HTTP status codes >= 501 (e.g. 502 Gateway Timeout, 503 Service Unavailable) could be returned by intermediate hops. Signed-off-by: Cory Snider <csnider@mirantis.com>
- Loading branch information
Showing
4 changed files
with
211 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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