prisma-queue icon indicating copy to clipboard operation
prisma-queue copied to clipboard

Having trouble wth long running idle transactions

Open eloff opened this issue 1 year ago • 1 comments

We're having some trouble with very long running 'idle in transsaction' connections from Prisma Queue.

Would it be possible to finish the transaction after running the polling query? It's definately the polling query and it stays in the 'idle in transaction' state for hours, which sets off an alarm in RDS.

UPDATE ""queue_jobs"" SET ""processedAt"" = NOW(), ""attempts"" = ""attempts"" + 1
           WHERE id = (
             SELECT id
             FROM ""queue_jobs""
             WHERE (""queue_jobs"".""queue"" = $1)
               AND (""queue_jobs"".""finishedAt"" IS NULL)
               AND (""queue_jobs"".""runAt"" < NOW())
               AND (""queue_jobs"".""notBefore"" IS NULL OR ""queue_jobs"".""notBefore"" < NOW())
             ORDER BY ""queue_jobs"".""priority"" ASC, ""queue_jobs"".""runAt"" ASC
             FOR UPDATE SKIP LOCKED
             LIMIT 1
           )
           RETURNING *;

eloff avatar Jul 02 '24 18:07 eloff

Hello, can you address this issue please ?

tracyloisel avatar Jun 24 '25 12:06 tracyloisel