Skip to content

Having trouble wth long running idle transactionsΒ #5

@eloff

Description

@eloff

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 *;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions