aperezdc/synpurge

Does synpurge take into account the fact that the purge API is now async?

Opened this issue · 3 comments

ara4n commented

Hi @aperezdc - apparently disroot.org's Matrix is currently down because they've tried to use synpurge and everything exploded. I stumbled across the problem and am trying to take a look at what they did, but from a quick inspection it looks like synpurge assumes that the /purge API is synchronous? Whereas in practice since March and matrix-org/synapse@e48c7aa#diff-5193fb8c4513ad3edf300808e59a10b1 the API has been async and returns immediately. Therefore I'm wondering if synpurge is firing off a tonne of simultaneous purge requests which then melt the server

Relatedly, I'm also wondering what the point is of the reindex button, which I think has been used here - recreating all the indexes on the DB is presumably likely to slow things down massively?

Ouch! It does certainly assume that the API endpoint is synchronous 😱

I'll put up a big warning in the README to warn about this issue, because I think neither me nor @psaavedra will have time to look into this soon.

ara4n commented

feels like the blame might be on our side for switching it to be async in a backwards incompatible manner, assuming that's what's happened here. sorry :(

wouldn't be a quickfix to add a delay of some seconds between each purge request.

maybe make it dependent on the size of the room.