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

Add retry for failed media downloads and tootctl media refresh #11775

Merged
merged 1 commit into from
Sep 10, 2019

Conversation

Gargron
Copy link
Member

@Gargron Gargron commented Sep 8, 2019

We download media attachments synchronously when processing a new remote status, so that we have all the information we need before the status is distributed to end-users through the streaming API &co. However, sometimes the download fails due to high load on the origin server, or Wasabi being an awfully unstable service. In those cases, we want to retry downloading specifically that attachment at a later time.

With this, a separate Sidekiq job will be queued with a random delay between 30 seconds and 10 minutes that attempts to re-download that attachment at most 3 times with exponential backoff.

Separately, there's a fix for not processing more than 4 media attachments for a status, since they will never be used within Mastodon (close #9325).

Furthermore, a new tootctl command, tootctl media refresh allows to re-download attachments for a particular status, a particular account, or a particular domain.

@Gargron
Copy link
Member Author

Gargron commented Sep 8, 2019

Because of changes in #11776, this should be refactored if #11776 is merged.

@Gargron Gargron merged commit 031ca25 into master Sep 10, 2019
@Gargron Gargron deleted the fix-failed-media-download branch September 10, 2019 13:29
rtucker pushed a commit to vulpineclub/mastodon that referenced this pull request Sep 10, 2019
hiyuki2578 pushed a commit to ProjectMyosotis/mastodon that referenced this pull request Oct 2, 2019
rtucker referenced this pull request in vulpineclub/mastodon Jan 7, 2021
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

Successfully merging this pull request may close these issues.

2 participants