Skip to content
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

Don't terminate if we already are #778

Closed
wants to merge 1 commit into from
Closed

Conversation

paulgb
Copy link
Member

@paulgb paulgb commented Jul 9, 2024

This prevents us from going from hard-terminating to soft-terminating, and from sending multiple SIGINTs.

Copy link

vercel bot commented Jul 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
plane ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 9, 2024 2:04pm

if termination == TerminationKind::Soft && kind == TerminationKind::Soft {
// We are already soft-terminating, don't change the kind.
return Ok(());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We currently already have a check in to_terminating that makes sure a hard terminate can't turn into a soft terminate. Maybe it makes sense to protect against sending more than one soft terminate, but I'm worried about dropping out here on a hard terminate. One reason is that the set_state call is one spot where we can actually detect that a hard terminating backend no longer exists and mark it as terminated. If a backend reaches a hard terminating state but we miss the event from docker to mark it as terminated, then I don't see a way the drone can ever mark the backend as terminated if we're dropping out here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm good point, I'll mark this as a draft and have another think through it.

@paulgb paulgb marked this pull request as draft July 9, 2024 14:19
@rolyatmax
Copy link
Member

Have we observed a user-facing problem that we're trying to fix with this PR? Have we seen several sigints being sent to the same backend?

@paulgb paulgb closed this Jul 24, 2024
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