Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(coderd/database): improve pubsub closure and context cancellation #7993

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

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Jun 13, 2023

This PR improves closure of Pubsub so that context cancellation is propagated to listeners and publish.

Since Pubsub has a Close method, we were incorrectly keeping a reference to the calling ctx so that it had side-effects after NewPubsub returned. This is bad because we mustn't have two ways to close a thing, especially when both leave the service half-open/half-closed). This has been fixed via internal context handling for Pubsub.

@mafredri mafredri force-pushed the mafredri/fix-coderd-database-pubsub-closure branch from 3c1b45c to 2b1fc55 Compare June 13, 2023 11:27
@mafredri mafredri force-pushed the mafredri/fix-coderd-database-pubsub-closure branch from 2b1fc55 to 118fcee Compare June 13, 2023 11:29
@mafredri mafredri merged commit 518300a into main Jun 13, 2023
@mafredri mafredri deleted the mafredri/fix-coderd-database-pubsub-closure branch June 13, 2023 12:19
@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants