agent: bounce session after failed status update#1539
Merged
LK4D4 merged 1 commit intomoby:masterfrom Sep 15, 2016
Merged
Conversation
Current coverage is 53.72% (diff: 0.00%)@@ master #1539 diff @@
==========================================
Files 82 82
Lines 13432 13430 -2
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
- Hits 7221 7215 -6
- Misses 5224 5227 +3
- Partials 987 988 +1
|
Contributor
Author
|
Confirmed fix with reproduction that always returns errors from Before this patch, we get the following in the logs: After applying this PR we get the following: While it will spam the logs with this simple recreation because we keep reestablishing the session, note that we are clearly in the backoff loop ("agent: rebuild session"). |
agent/session.go
Outdated
| @@ -342,11 +344,15 @@ func (s *session) close() error { | |||
| case <-s.closed: | |||
| return errSessionClosed | |||
| default: | |||
Collaborator
There was a problem hiding this comment.
Do we need the select with the addition of this sync.Once?
Previously, failed calls on an agent session to UpdateTaskStatus weren't causing the agent to fall back into the session creation retry loop. Without the retry loop, the agent ends up pounding the dispatcher with status updates that will never drain. This PR closes the session on a fatal error, ensuring that the agent will fallback into a retry loop. Signed-off-by: Stephen J Day <stephen.day@docker.com>
4f045f8 to
353423b
Compare
Collaborator
|
LGTM |
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.
Previously, failed calls on an agent session to UpdateTaskStatus weren't
causing the agent to fall back into the session creation retry loop.
Without the retry loop, the agent ends up pounding the dispatcher with
status updates that will never drain.
This PR closes the session on a fatal error, ensuring that the agent
will fallback into a retry loop.
Consider backporting this change to 1.12.2.
Signed-off-by: Stephen J Day stephen.day@docker.com
cc @aaronlehmann
Closes #1533