Skip to content

feat: add watchdog to pubsub #12011

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
Feb 6, 2024
Merged

feat: add watchdog to pubsub #12011

merged 1 commit into from
Feb 6, 2024

Conversation

spikecurtis
Copy link
Contributor

@spikecurtis spikecurtis commented Feb 5, 2024

adds a watchdog to our pubsub and runs it for Coder server.

If the watchdog times out, it triggers a graceful exit in coder server to give any provisioner jobs a chance to shut down.

c.f. #11950

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @spikecurtis and the rest of your teammates on Graphite Graphite

@spikecurtis spikecurtis force-pushed the spike/11950-pubsub-watchdog branch from 5d02e30 to d4cc468 Compare February 6, 2024 06:16
@spikecurtis spikecurtis marked this pull request as ready for review February 6, 2024 06:19
@spikecurtis spikecurtis force-pushed the spike/11950-pubsub-watchdog branch from d4cc468 to 4624bf1 Compare February 6, 2024 06:23
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice clock usage.


func (w *Watchdog) subscribeMonitor() {
defer w.wg.Done()
beats := make(chan struct{})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is unbuffered, should we make it non-blocking in case of any perf issues?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PGPubsub buffers events in a ring-buffer, another buffer would be redundant.

@spikecurtis spikecurtis force-pushed the spike/11950-pubsub-watchdog branch from 4624bf1 to 31c5c83 Compare February 6, 2024 12:49
@spikecurtis spikecurtis merged commit e09cd2c into main Feb 6, 2024
@spikecurtis spikecurtis deleted the spike/11950-pubsub-watchdog branch February 6, 2024 12:58
Copy link
Contributor Author

Merge activity

@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2024
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