LemmyNet/activitypub-federation-rust

do_send should retry failed connections

null-dev opened this issue · 1 comments

I see on this line that if the send fails due to a connection error, it does not get retried:

"Unable to connect to {}, aborting task {}: {}",

But there are cases where it should definitely retry. For example, today lemmy.ml is overloaded so many subscribe operations are not going through:

lemmy-lemmy-1     | 2023-06-12T14:51:09.410929Z DEBUG Worker{worker.id=867f1e83-24de-4363-a3ff-ee742f67c9b6 worker.queue=default worker.operation.id=9f4792c7-e83a-44f7-9536-236e48b82cd8 worker.operation.name=process}:Job{execution_id=b12ecf19-efec-4438-a352-9612c22d384b job.id=272231c7-803d-4f7f-a35d-d7800e0fe08b job.name=SendActivityTask}: activitypub_federation::core::activity_queue: Sending https://lemmy.vepta.org/activities/follow/f4dc629c-297a-47b2-bb75-cac9ece6d1f4 to https://lemmy.ml/inbox    
lemmy-lemmy-1     | 2023-06-12T14:51:19.414603Z  INFO Worker{worker.id=867f1e83-24de-4363-a3ff-ee742f67c9b6 worker.queue=default worker.operation.id=9f4792c7-e83a-44f7-9536-236e48b82cd8 worker.operation.name=process}:Job{execution_id=b12ecf19-efec-4438-a352-9612c22d384b job.id=272231c7-803d-4f7f-a35d-d7800e0fe08b job.name=SendActivityTask}: activitypub_federation::core::activity_queue: Unable to connect to https://lemmy.ml/inbox, aborting task https://lemmy.vepta.org/activities/follow/f4dc629c-297a-47b2-bb75-cac9ece6d1f4: Request error: error sending request for url (https://lemmy.ml/inbox): operation timed out

If the operation is not retried, the user will never be subscribed unless they manually re-subscribe.

That makes sense. Would you make a PR?