Steps to reproduce the problem
- Have an active mastodon server
- Use a few queue workers on one IP address
- Send a lot (>60 requests / 5 seconds) of notification push requests to ntfy
Expected behaviour
Notification jobs to work, or at least not die unnecessarily after a lot of processes.
Actual behaviour
Observe jobs failing with 429 codes at first, but eventually failing with connect timeouts
Detailed description
Ntfy.sh has a rate limit of how many requests it can take a second. It tries to back off servers with a 429 mechanism, to throttle and have it retry later.
However, mastodon's queuing system will not throttle itself in such a situation, instead, it will keep trying, while the server keeps returning 429, until eventually the server gets banned via fail2ban.
Specifications
Mastodon v4.1.4
Steps to reproduce the problem
Expected behaviour
Notification jobs to work, or at least not die unnecessarily after a lot of processes.
Actual behaviour
Observe jobs failing with 429 codes at first, but eventually failing with connect timeouts
Detailed description
Ntfy.sh has a rate limit of how many requests it can take a second. It tries to back off servers with a 429 mechanism, to throttle and have it retry later.
However, mastodon's queuing system will not throttle itself in such a situation, instead, it will keep trying, while the server keeps returning 429, until eventually the server gets banned via fail2ban.
Specifications
Mastodon v4.1.4