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

history: handle gracefulstop when history is active #5522

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

tonistiigi
Copy link
Member

@tonistiigi tonistiigi commented Nov 15, 2024

depends on #5515

When GracefulStop is called, gRPC waits for current requests to finish
before closing. While this is generally the behavior we want, it is
not always the same for the History.Listen endpoint. That endpoint is
usually open even if buildkit is not actively processing any builds,
because the client may be waiting for new events.

The new logic is that if GracefulStop happens, history will
close active listeners if there are no active builds. If there are
active builds, then active listeners will be closed after all the
active builds have completed their finalizers.

Signed-off-by: Tonis Tiigi tonistiigi@gmail.com

When GracefulStop is called gRPC waits for current requests to finish
before closing. While this is generally the behavior we want, it is
not always same for the History.Listen endpoint. That endpoint is
usually open even if buildkit is not actively processing any builds,
because client may be waiting for new events.

The new logic is that if GracefulStop will happen, history will
close active listeners if there are no active builds. If there are
active builds then active listeners will be closed after all the
active builds have completed their finalizers.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@tonistiigi tonistiigi force-pushed the history-gracefulstop-fix branch from b241581 to c45cd8f Compare November 15, 2024 18:59
@tonistiigi tonistiigi marked this pull request as ready for review November 15, 2024 18:59
@crazy-max crazy-max added this to the v0.18.0 milestone Nov 20, 2024
@tonistiigi tonistiigi merged commit e853c88 into moby:master Nov 20, 2024
92 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants