Skip to content

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

Merged
Gargron merged 1 commit intomasterfrom
fix-failed-media-download
Sep 10, 2019
Merged

Add retry for failed media downloads and tootctl media refresh#11775
Gargron merged 1 commit intomasterfrom
fix-failed-media-download

Conversation

@Gargron
Copy link
Copy Markdown
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
Copy Markdown
Member Author

Gargron commented Sep 8, 2019

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

@Gargron Gargron force-pushed the fix-failed-media-download branch from f0b10e5 to 1c34f17 Compare September 10, 2019 12:54
@Gargron Gargron force-pushed the fix-failed-media-download branch from 1c34f17 to 0b2a539 Compare September 10, 2019 13:11
@Gargron Gargron merged commit 031ca25 into master Sep 10, 2019
@Gargron Gargron deleted the fix-failed-media-download branch September 10, 2019 13:29
hiyuki2578 pushed a commit to ProjectMyosotis/mastodon that referenced this pull request Oct 2, 2019
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