Closed andrewmurraydavid closed 4 months ago
UnauthorizedExceptions should not be treated as retryable. But maybe it was the error from the other queries? I don't think this is the root solution, other queries in parallel could trigger this symptom too. But I'm pretty sure EdgeDB doesn't even let you run queries in parallel while in a transaction so there's that too. Which warrants this change.
Good job @andrewmurraydavid! Race conditions are hard to track down :+1:
Cord API memory leak causing AWS crash
Description
This PR changes how the engagements are updated in the project handler. There seems to be an issue, either with the the way
Promise.all
handles the UnauthorizedException for the edgecase where a project has 3 engagements, one (or more) of them being in a step previous (for example 2 inActive change plan
and 1 inDiscussing change plan
), the engagement update would fail with the UnauthorizedException.It is assumed that because Promis.all not handling the exception properly, would cause a neo4j transaction creation to retry in an infinite loop.
This infinite loop caused the API service to crash completely being OOM (out of memory).
Steps to reproduce the bug
In the description
Expected behavior
Not crash, lol
Ready for review checklist