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

Ensure the log streamer respects forced shutdown of the agent #3180

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

wolfeidau
Copy link
Contributor

@wolfeidau wolfeidau commented Feb 7, 2025

Currently if the agent is sent a sigterm the log streamer will wait for all chunks to be uploaded, and even if a second sigterm is sent we still wait.

Other components of the agent honor the a graceful=false flag which allows operators to force the agent to stop.

This change adds that graceful option to the log streamer stop.

Description

This change introduces immediate cancellation to the log streamer when the agent is forced to stop.

Context

If customers egress is overloaded, or there is a large backlog of chunks to upload, and that is blocked due to internet connectivity issues, the agent can block for extended periods waiting to upload chuncks even if has been "forced" to quit.

Changes

Adds a simple way to signal to the uploader workers to stop work and quite immediately when the agent has been told to exit and cancel.

Testing

  • Tests have run locally (with go test ./...). Buildkite employees may check this if the pipeline has run automatically.
  • Code is formatted (with go fmt ./...)

Currently if the agent is sent a sig term the log streamer will wait for all chunks to be uploaded, and even if a second sig term is sent we still wait.

Other components of the agent honor the a graceful=false flag which allows operators to force the agent to stop.

This change adds that graceful option to the log streamer stop.
@wolfeidau wolfeidau changed the title Make it so the log streamer can be signaled to stop immediately Ensure the log streamer respects forced shutdown of the agent Feb 7, 2025
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.

1 participant