timgit / pg-boss

Queueing jobs in Postgres from Node.js like a boss
MIT License
2.15k stars 160 forks source link

Exception while scheduling job #509

Closed aslushnikov closed 1 month ago

aslushnikov commented 1 month ago

Hi Tim,

I'm running pg-boss 10.1.4.

I've recently started receiving the following exception when trying to send a job to a stately queue:

/Users/aslushnikov/flakiness/node_modules/pg-boss/src/manager.js:376
    const { rows } = await db.executeSql(this.insertJobCommand, values)
            ^

TypeError: Cannot destructure property 'rows' of '(intermediate value)' as it is undefined.
    at Manager.createJob (/Users/aslushnikov/flakiness/node_modules/pg-boss/src/manager.js:376:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Manager.createJob (/Users/aslushnikov/flakiness/node_modules/pg-boss/src/manager.js:394:12)
    at async Manager.send (/Users/aslushnikov/flakiness/node_modules/pg-boss/src/manager.js:298:12)
    at async SingletonQueue.schedule (file:///Users/aslushnikov/flakiness/server/lib/node/queueManager.js:80:5)

Weirdly, the error is flaky, with error rate above 50% for me.

I'm trying to reproduce this outside of our production app but no luck so far. Let me know if you can figure this out from the stack alone - I'll stop my attempts to repro this in isolation.

Thanks, Andrey

aslushnikov commented 1 month ago

ah, please disregard. Turns out i was stopping pg-boss too fast in my tests.