Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Cancel tail -f on pubsub then exit results in warning #711

Closed
MikaelSmith opened this issue Feb 5, 2020 · 0 comments · Fixed by #747
Closed

Cancel tail -f on pubsub then exit results in warning #711

MikaelSmith opened this issue Feb 5, 2020 · 0 comments · Fixed by #747
Labels
bug Something isn't working

Comments

@MikaelSmith
Copy link
Contributor

If I run tail -f <pubsub> on a GCP Pub/Sub, then Ctrl-C and exit Wash, I get

WARN API: Shutdown failed: context canceled

I expect no warning.

@MikaelSmith MikaelSmith added the bug Something isn't working label Feb 5, 2020
MikaelSmith added a commit to MikaelSmith/wash that referenced this issue Mar 5, 2020
When `Shutdown` is called on a net/http `Server`, it causes the `Serve`
function to return but may still have further cleanup to do. The
previous implementation sent a signal that shutdown was complete once
`Serve` returned, which would cancel a timeout context. If the server
was still actually cleaning up, we might get an error from `Shutdown`
because the context it was using was canceled.

Close the stopped channel once `Shutdown` returns to trigger cleanup.

Fixes puppetlabs-toy-chest#711.

Signed-off-by: Michael Smith <michael.smith@puppet.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant