-
Notifications
You must be signed in to change notification settings - Fork 523
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
Add shutdown delay and e2e test #3395
Conversation
Signed-off-by: Joe Elliott <number101010@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one small Q, rest lgtm 👍🏼
integration/e2e/e2e_test.go
Outdated
// confirm the readiness flag is down | ||
res, err := e2e.DoGet("http://" + tempo.Endpoint(3200) + "/ready") | ||
require.NoError(t, err) | ||
require.Equal(t, http.StatusServiceUnavailable, res.StatusCode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps perform a query before and after to confirm the change in behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not apparent, but this line waits until /ready
returns 200:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a comment to help clarify that the /ready point is confirmed to be up before we stop tempo
t.Server.SetKeepAlivesEnabled(false) | ||
|
||
if t.cfg.ShutdownDelay > 0 { | ||
time.Sleep(t.cfg.ShutdownDelay) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we also want to sleep when there are no requests in flight?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm concerned about the complexity about that change. this is a very simple one that will do nearly all of what we want with some config choices in k8s
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its a step in the right direction.
* Add shutdown delay and e2e test Signed-off-by: Joe Elliott <number101010@gmail.com> * changelog Signed-off-by: Joe Elliott <number101010@gmail.com> * determinism + comment Signed-off-by: Joe Elliott <number101010@gmail.com> * .Stop in a different goroutine then .Start creates a race Signed-off-by: Joe Elliott <number101010@gmail.com> --------- Signed-off-by: Joe Elliott <number101010@gmail.com>
What this PR does:
Adds a shutdown delay configurable parameter modeled after mimir:
grafana/mimir#3298
After receiving SIGTERM Tempo will drop its readiness handler and wait the configured seconds. In a k8s environment this will allow Tempo to cleanly roll its frontend without dropping queries.
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]