hyphacoop / distributed-press-organizing

15 stars 1 forks source link

Timeouts on social.distributed.press #151

Open fauno opened 7 months ago

fauno commented 7 months ago

I'm getting timeouts while approving a Follow request and it's difficult to parse logs, so I'm not sure if the request is triggering fetches to remote instances and failing or some requests are happening at the same time.

I set the timeout to 1s to avoid crashing the CMS but this seems to low for current requests (but too high for B2B connections?)

fauno commented 7 months ago

Now it worked, but I don't know why

fauno commented 7 months ago

we discussed replying the request with a collection of requests statuses but i'm not sure now if i opened an issue about this, so i'm leaving this comment to not forget again

catdevnull commented 6 months ago

This happens when POSTing the outbox as it sends a request to every following instance

https://github.com/hyphacoop/social.distributed.press/blob/3e9c803a050ef5342c16441fa048951eccae1f52/src/server/api/outbox.ts#L41

We should probably return instantly to the outbox request, and queue the requests to other instances (with p-queue). Maybe also set the amount to do parallel with something like p-map. Or ideally a queue that persists to disk (to also retry on failed.)

fauno commented 6 months ago

This is important because the notification step during site build is going to take as long as the slowest instance (or a timeout)