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

Respond to cancelled context while streaming logs #989

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

jonjohnsonjr
Copy link
Contributor

@jonjohnsonjr jonjohnsonjr commented Feb 6, 2024

Since StdCopy is a blocking call, even if ctx is cancelled, we won't actually clean up any containers. This ~fixes that.

This isn't a complete solution, but it's really straightfoward to implement, so I'm starting here. This only works when logs are being actively streamed (so we are actually calling Read). If the container isn't very chatty, this isn't as effective.

This is harmless to keep in, but we can also remove it when we have a better solution.

Since StdCopy is a blocking call, even if ctx is cancelled, we won't
actually clean up any containers.

This isn't a complete solution, but it's really straightfoward to
implement, so I'm starting here. This only works when logs are being
actively streamed (so we are actually calling Read). If the container
isn't very chatty, this isn't as effective.

This is harmless to keep in, but we can also remove it when we have a
better solution.

Signed-off-by: Jon Johnson <jon.johnson@chainguard.dev>
@imjasonh imjasonh merged commit 85e4dce into chainguard-dev:main Feb 6, 2024
32 checks passed
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.

2 participants