citusdata / pg_cron

Run periodic jobs in PostgreSQL
PostgreSQL License
2.8k stars 191 forks source link

pg_cron for PostgreSQL 12 stops working with message LOG: cron job 1 job startup timeout #210

Open darshansh opened 1 year ago

darshansh commented 1 year ago

Hello,

I have set up pg_cron on PostgreSQL 12 on production server. It was working properly. Suddenly it stops working with message LOG: cron job 1 job startup timeout.

I have tried below options still getting same message.

  1. I have restarted PostgreSQL service.
  2. Tried to create new job and tested.
  3. Removed pg_cron extension and recreated it. There is no pg_cron parameter available to change timeout value.

As per analysis this is the log. And job command didn't start within 10 sec so it was timeout.

2022-10-06 15:35:00.000 CEST [8334] DEBUG: StartTransaction(1) name: unnamed; blockState: DEFAULT; state: INPROGRESS, xid/subid/cid: 0/1/0 2022-10-06 15:35:00.000 CEST [8334] DEBUG: CommitTransaction(1) name: unnamed; blockState: STARTED; state: INPROGRESS, xid/subid/cid: 51366430/1/0 2022-10-06 15:35:00.000 CEST [8334] DEBUG: StartTransaction(1) name: unnamed; blockState: DEFAULT; state: INPROGRESS, xid/subid/cid: 0/1/0 2022-10-06 15:35:00.001 CEST [8334] DEBUG: CommitTransaction(1) name: unnamed; blockState: STARTED; state: INPROGRESS, xid/subid/cid: 51366431/1/1 2022-10-06 15:35:00.001 CEST [8334] LOG: cron job 1 starting: Refresh Materialized view CONCURRENTLY vw_publicmap_moor; 2022-10-06 15:35:00.001 CEST [8334] DEBUG: StartTransaction(1) name: unnamed; blockState: DEFAULT; state: INPROGRESS, xid/subid/cid: 0/1/0 2022-10-06 15:35:00.001 CEST [8334] DEBUG: CommitTransaction(1) name: unnamed; blockState: STARTED; state: INPROGRESS, xid/subid/cid: 51366432/1/1 2022-10-06 15:35:10.000 CEST [8334] DEBUG: StartTransaction(1) name: unnamed; blockState: DEFAULT; state: INPROGRESS, xid/subid/cid: 0/1/0 2022-10-06 15:35:10.000 CEST [8334] DEBUG: CommitTransaction(1) name: unnamed; blockState: STARTED; state: INPROGRESS, xid/subid/cid: 51366445/1/1 2022-10-06 15:35:10.000 CEST [8334] LOG: cron job 1 job startup timeout

How to resolve this issue ?

darshansh commented 1 year ago

Any hint on this ?