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.
Subscribers (http and discord) can both die.
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.
statuscolumn in the subscribers/subscriptions tableALIVEby defaultlast_alivecolumn in the subscribers/subscriptions tableDEAD)This strategy will avoid wasting resources on dead subscribers.