Skip to content

Mastodon does not respect ntfy.sh's 429 responses and gets temporarily ip-blacklisted #26078

Description

@ShadowJonathan

Steps to reproduce the problem

  1. Have an active mastodon server
  2. Use a few queue workers on one IP address
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions