Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sometimes error will emit at start() because of deadlock #133

Closed
timgit opened this issue Oct 30, 2019 · 0 comments
Closed

sometimes error will emit at start() because of deadlock #133

timgit opened this issue Oct 30, 2019 · 0 comments
Labels

Comments

@timgit
Copy link
Owner

timgit commented Oct 30, 2019

Ran into this recently so creating this for future reference. This hapens during start() since multiple promises run simultaneously to begin monitoring the job tables. connect() is not affected. The impact of this should be low, since the intervals of running each query in question are different and the likelihood of this specific collision is so low the only time I've seen this emit the error event is at start().

    "err": {
        "type": "Error",
        "message": "deadlock detected",
        "stack": "error: deadlock detected\n    at Connection.parseE (/opt/infocyte/api/node_modules/pg/lib/connection.js:604:11)\n    at Connection.parseMessage (/opt/infocyte/api/node_modules/pg/lib/connection.js:401:19)\n    at TLSSocket.<anonymous> (/opt/infocyte/api/node_modules/pg/lib/connection.js:121:22)\n    at TLSSocket.emit (events.js:210:5)\n    at TLSSocket.EventEmitter.emit (domain.js:476:20)\n    at addChunk (_stream_readable.js:308:12)\n    at readableAddChunk (_stream_readable.js:289:11)\n    at TLSSocket.Readable.push (_stream_readable.js:223:10)\n    at TLSWrap.onStreamRead (internal/stream_base_commons.js:182:23)",
        "name": "error",
        "length": 332,
        "severity": "ERROR",
        "code": "40P01",
        "detail": "Process 5611 waits for ShareLock on transaction 244217582; blocked by process 5612.\nProcess 5612 waits for ShareLock on transaction 244217534; blocked by process 5611.",
        "hint": "See server log for query details.",
        "where": "while deleting tuple (3269,8) in relation \"job\"",
        "file": "deadlock.c",
        "line": "1146",
        "routine": "DeadLockReport"
    },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant