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

Changed retries and rescued in ActivityPub::ProcessingWorker #14355

Merged

Conversation

noellabo
Copy link
Contributor

  • Reduce the number of retries, as repeated retries are not effective.
  • Give up RecordNotUnique immediately.

Copy link
Member

@Gargron Gargron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine but would like opinion from @ThibG as well

@ClearlyClaire
Copy link
Contributor

Hmm… where would ActiveRecord::RecordNotUnique be raised? It seems fine, but it may also hide bugs, I guess…
I think reducing the number of retries should be fine: while temporary errors are possible, they seem unlikely.

@noellabo
Copy link
Contributor Author

The cause of ActiveRecord::RecordNotUnique has not been identified. May be due to configuration. I'll investigate more closely.

On the other hand, this error report is useful to the developer, but I'm not sure if it helps the server administrator, because the server administrator can't handle it.

P.S.
My server is accessing two replicated PostgreSQL servers through makara from puma and sidekiq located in different VPS operators. I am getting the above error from time to time.

@ClearlyClaire
Copy link
Contributor

Well, having the error visible to administrators would enable them reporting it to us. I'd be more confident with this patch if we knew what caused that error, even though it's unlikely to be a big deal.

@Gargron
Copy link
Member

Gargron commented Jul 19, 2020

Sidekiq may process jobs before data has replicated in postgresql, leading to some jobs being discarded (because we often catch and discard record not found errors). One of the reasons why my Sidekiq is connected directly to master... i wonder if you experience the same issue?

@noellabo
Copy link
Contributor Author

I am monitoring for dead jobs where RecordNotUnique occurs.

  1. Duplication of index_statuses_on_uri by Announce
  2. Duplication of index_favourites_on_account_id_and_status_id by Like

My server has 3 relays connected and the same Object is often reached 4 times in Create or Announce.

The cause of RecordNotUnique has been resolved, so I will leave it so that I notice the abnormality when it occurs again.

@ClearlyClaire
Copy link
Contributor

Hmm, not sure what to do about the Misskey reactions… maybe just… drop them, since they don't really mean the same thing as a Like?

@Gargron Gargron merged commit a8b6524 into mastodon:master Jul 20, 2020
shouo1987 pushed a commit to CrossGate-Pawoo/mastodon that referenced this pull request Dec 7, 2022
…n#14355)

* Changed the number of retries and rescued exceptions in ActivityPub::ProcessingWorker

* Remove RecordNotUnique from rescue
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