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

Avoid race condition when streaming deleted statuses #10280

Merged

Conversation

ClearlyClaire
Copy link
Contributor

This relies on new redis locks and values so I'm not sure how efficient that is.
But I can't see other ways to prevent those race conditions (basically, DistributeWorker doing its job while a status has been/is being deleted, resulting in the status being pushed to timelines after it was deleted).

@ClearlyClaire ClearlyClaire force-pushed the fixes/streaming-delete-race-condition branch 3 times, most recently from 03baf47 to a026b85 Compare March 15, 2019 12:52
@ClearlyClaire ClearlyClaire force-pushed the fixes/streaming-delete-race-condition branch from a026b85 to 0f0758c Compare March 15, 2019 13:35
@ClearlyClaire
Copy link
Contributor Author

Ok, this was a bit trickier than expected, as FanOutOnWriteService does itself push updates asynchronously to redis, so I locked the whole unpush until delete thing into a redis lock.

@ClearlyClaire ClearlyClaire marked this pull request as ready for review March 15, 2019 13:41
@ClearlyClaire ClearlyClaire force-pushed the fixes/streaming-delete-race-condition branch from fadf369 to e1ca3c5 Compare March 15, 2019 18:02
@ClearlyClaire ClearlyClaire force-pushed the fixes/streaming-delete-race-condition branch from e1ca3c5 to 4f73117 Compare March 15, 2019 18:23
@Gargron Gargron merged commit 6b0eda1 into mastodon:master Mar 16, 2019
hiyuki2578 pushed a commit to ProjectMyosotis/mastodon that referenced this pull request Oct 2, 2019
* Avoid race condition when streaming deleted statuses

* Move redis lock to DistributionWorker to avoid extra Redis value
messenjahofchrist pushed a commit to Origin-Creative/mastodon that referenced this pull request Jul 30, 2021
* Avoid race condition when streaming deleted statuses

* Move redis lock to DistributionWorker to avoid extra Redis value
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.

None yet

3 participants