mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-30 02:23:47 +00:00
2d12948220
There is an idempotency key generated by clients when authoring a post, and stored in Redis, to ensure that if a user or client retries posting the same status, we don't get a duplicate. Hachyderm.io has been experiencing some filesystem and database performance issues, causing database writes to be slow. This can mean that there are successful posts, but the reverse proxy returns 504 Gateway Timeout before the idempotency status has been updated; users or clients who retry (such as Tusky which retries automatically, see tuskyapp/Tusky#2951) can re-try the same post with the same idempotency key before it has actually been recorded in Redis, leading to duplicate posts. To address this issue, move all of the database updates after the initial transaction that creates the status into the `postprocess_status!` method, so we can insert the idempotency key immediately after the status has been created, significantly reducing the window in which the status could be created but the idempotency key not yet stored. Note: this has not yet been tested; I'm submitting this PR for discussion and to offer to the Hachyderm.io admins to try out to fix the multiple posting problem. Co-authored-by: Brian Campbell <brcampbell@beta.team> |
||
---|---|---|
.. | ||
activitypub | ||
concerns | ||
keys | ||
account_search_service.rb | ||
account_statuses_cleanup_service.rb | ||
after_block_domain_from_account_service.rb | ||
after_block_service.rb | ||
after_unallow_domain_service.rb | ||
app_sign_up_service.rb | ||
appeal_service.rb | ||
approve_appeal_service.rb | ||
authorize_follow_service.rb | ||
backup_service.rb | ||
base_service.rb | ||
batched_remove_status_service.rb | ||
block_domain_service.rb | ||
block_service.rb | ||
bootstrap_timeline_service.rb | ||
clear_domain_media_service.rb | ||
create_featured_tag_service.rb | ||
delete_account_service.rb | ||
deliver_to_device_service.rb | ||
fan_out_on_write_service.rb | ||
favourite_service.rb | ||
fetch_link_card_service.rb | ||
fetch_oembed_service.rb | ||
fetch_remote_status_service.rb | ||
fetch_resource_service.rb | ||
follow_service.rb | ||
import_service.rb | ||
move_service.rb | ||
mute_service.rb | ||
notify_service.rb | ||
post_status_service.rb | ||
precompute_feed_service.rb | ||
process_hashtags_service.rb | ||
process_mentions_service.rb | ||
purge_domain_service.rb | ||
reblog_service.rb | ||
reject_follow_service.rb | ||
remove_featured_tag_service.rb | ||
remove_from_followers_service.rb | ||
remove_status_service.rb | ||
report_service.rb | ||
resolve_account_service.rb | ||
resolve_url_service.rb | ||
search_service.rb | ||
suspend_account_service.rb | ||
tag_search_service.rb | ||
translate_status_service.rb | ||
unallow_domain_service.rb | ||
unblock_domain_service.rb | ||
unblock_service.rb | ||
unfavourite_service.rb | ||
unfollow_service.rb | ||
unmute_service.rb | ||
unsuspend_account_service.rb | ||
update_account_service.rb | ||
update_status_service.rb | ||
verify_link_service.rb | ||
vote_service.rb | ||
webhook_service.rb |