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

fix: check if context is nil when logging coordination delete errors #13192

Closed
wants to merge 1 commit into from

Conversation

kylecarbs
Copy link
Member

I'm not exactly sure how to handle this idiomatically...

See: https://github.com/coder/coder/actions/runs/8976564938/job/24653672411

@kylecarbs kylecarbs requested a review from spikecurtis May 6, 2024 22:56
@kylecarbs kylecarbs self-assigned this May 6, 2024
@kylecarbs
Copy link
Member Author

@spikecurtis we could check directly for the sql: database is closed error, but I'm weary to do so as the error isn't exported in the stdlib sql package.

@spikecurtis
Copy link
Contributor

Really, we shouldn't even be starting a PGCoordinator to test the licensing APIs of Coderd. This is a canonical example of a test that is doing way to much and so errors in an unrelated part of the code are causing it to flake.

That said, PGCoordinator doesn't have a synchronous Close(). It just cancels the context. Considering that it does this cleanup work like deleting the row from the database, we really should fix the close to be synchronous. In a real deployment we would have failed to delete the row and left a bunch of cruft in the database for other Coordinators to have to filter out. So, this is a real product bug, not just a test bug.

@github-actions github-actions bot added the stale This issue is like stale bread. label May 15, 2024
@github-actions github-actions bot closed this May 19, 2024
spikecurtis added a commit that referenced this pull request May 24, 2024
c.f. #13192 (comment)

We need to wait for PGCoordinator to finish its work before returning on `Close()`, so that we delete database state (best effort -- if this fails others will filter it out based on heartbeats).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This issue is like stale bread.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants