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

feat: disable dead subscribers #67

Open
wa0x6e opened this issue Jul 14, 2023 · 3 comments
Open

feat: disable dead subscribers #67

wa0x6e opened this issue Jul 14, 2023 · 3 comments

Comments

@wa0x6e
Copy link
Contributor

wa0x6e commented Jul 14, 2023

Subscribers (http and discord) can both die.

  • A request to a dead http endpoint will either time out, or reject immediately
  • A dead discord (channel removed, permissions issues) will return an error by the discord API

In the case of timeout, connection will be open until timeout, so it's holding a TCP connection open for 30s (or whatever the timeout is set to) open, for nothing.

We should have a strategy to disable dead subscribers.

  • Add a status column in the subscribers/subscriptions table
  • Everyone has status ALIVE by default
  • Add a last_alive column in the subscribers/subscriptions table
  • Touch that column on success request
  • Each time we send a request, and it fails, we check that column and see for how long it was dead.
  • If dead for more than X days, we mark the subscriber as dead (update status to DEAD)
  • We send webhook events only to alive subscribers

This strategy will avoid wasting resources on dead subscribers.

@sentry-io
Copy link

sentry-io bot commented Jul 14, 2023

Sentry issue: SNAPSHOT-WEBHOOK-4

@sentry-io
Copy link

sentry-io bot commented Jul 14, 2023

Sentry issue: SNAPSHOT-WEBHOOK-3

@sentry-io
Copy link

sentry-io bot commented Jul 14, 2023

Sentry issue: SNAPSHOT-WEBHOOK-5

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

No branches or pull requests

1 participant