Server process (PID xxx) exited with exit code 4

I’m working with postgre version15.2 on Windows 10。From time to time a postgres process terminates with following messages:

DEBUG:  00000: server process (PID 27740) exited with exit code 4
DETAIL:  Failed process was running: COMMIT
LOCATION:  LogChildExit, postmaster.c:3744
LOG:  00000: server process (PID 27740) exited with exit code 4
DETAIL:  Failed process was running: COMMIT
LOCATION:  LogChildExit, postmaster.c:3744
LOG:  00000: terminating any other active server processes
LOCATION:  HandleChildCrash, postmaster.c:3505
DEBUG:  00000: sending SIGQUIT to process 18156
.
.
.
DEBUG:  00000: server process (PID 24640) exited with exit code 1
LOCATION:  LogChildExit, postmaster.c:3744
LOG:  00000: all server processes terminated; reinitializing
LOCATION:  PostmasterStateMachine, postmaster.c:4019
DEBUG:  00000: unregistering background worker "TimescaleDB Background Worker Scheduler"
LOCATION:  ForgetBackgroundWorker, bgworker.c:449
DEBUG:  00000: cleaning up orphaned dynamic shared memory with ID 915126130
LOCATION:  dsm_postmaster_shutdown, dsm.c:372
DEBUG:  00000: cleaning up dynamic shared memory control segment with ID 847152456
LOCATION:  dsm_postmaster_shutdown, dsm.c:382
DEBUG:  42501: could not enable user right "Lock pages in memory"
HINT:  Assign user right "Lock pages in memory" to the Windows user account which runs PostgreSQL.
LOCATION:  EnableLockPagesPrivilege, win32_shmem.c:184
DEBUG:  00000: disabling huge pages
LOCATION:  PGSharedMemoryCreate, win32_shmem.c:248
DEBUG:  00000: dynamic shared memory system will support 1169 segments
LOCATION:  dsm_postmaster_startup, dsm.c:171
DEBUG:  00000: created dynamic shared memory control segment 673225418 (46776 bytes)
LOCATION:  dsm_postmaster_startup, dsm.c:197
DEBUG:  00000: forked new backend, pid=6680 socket=4284
LOCATION:  BackendStartup, postmaster.c:4261

After a process exited with exit code 4, all other active server processes will be terminated and reinitialized。Sometimes this can cause “FATAL: 57P03: the database system is in recovery mode” and the connection from the backend to the database to be interrupted.

The postgres child process would ever choose to exit with exit code 4; it use 0,1 and 2, but not 4. I am thinking that maybe the timescaledb extension cause this?

Has anybody an idea what can cause this? i have modified the config log_min_messages=debug3 and log_min_error_statement=debug3 and still haven’t get userful log messages.

Is it possible that the antivirus software cause this or that the hard disk has bad tracks?

Hi @YangYang , is there any chance to run the same workload on linux to confirm it’s a windows only issue?

What is the timescaledb extension version you’re using?

The entire system is a bit complex, and move from Windows to Linux requires a lot of work。

The “Server process (PID XXX) exited with exit code 4” may be caused by anti-virus software. After exiting it yesterday, this error didn’t happen again, but that’d certainly be something to watch.

timescaledb version is 2.11.1, as mentioned in this link。Until now the “database system was interrupted” problem has not been studied。。。

1 Like

Yes, probably if it’s the antivirus, it’s generic to postgresql on windows, not directly related to Timescale. I found a related forum question.