timgit / pg-boss

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

Undefined value for expire_in_seconds #502

Closed diogoastavares closed 1 month ago

diogoastavares commented 1 month ago

Hi @timgit

My jobs are getting status failed, due to the fact that the expiration time is not being correctly set up. I'm setting up a job that should expire within an hour running (using option expireInHours), however I'm getting the following error.

"message": "handler execution exceeded NaNms"

Accordingly to my investigation, this error comes from the resolveWithinSeconds method, that is receiving an undefined value on job.expire_in_seconds. Going deeper on this, I found out that the problems is that when running the query that retrieves the jobs (plans.fetchNextJob) the output should have the results in snake case. However everything is in camel case, turning that when trying to resolve job.expire_in_seconds it is not able to find any value that matches that key.

[{"id":"fd427610-8176-11ef-9ad6-cfc52ed56098","name":"refreshMaterializedViews","data":null,"expireInSeconds":"3600.000000"}]

Is there any configuration to make this snake case?

timgit commented 1 month ago

try upgrading to a newer version than 7.3.0. This has been fixed in a more recent release

diogoastavares commented 1 month ago

@timgit on what release this was fixed?

The idea is to migrate pg-boss version from v4.3.4 to v9.0.3. Considering that, planned a phased migration:

I tested for v9.0.3 and that problems still exists.

timgit commented 1 month ago

It might be because you're passing in text instead of number?