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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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 [email protected]

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 <[email protected]>
@tonistiigi tonistiigi marked this pull request as ready for review November 15, 2024 18:59
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.

1 participant