Skip to content

Commit ec6740f

Browse files
committed
Fix sporadic health check failures due to authentication failure.
It is reported that health check process fails due to authentication failures. [pgpool-general: 9236] Sporadic health check failures due to authentication failure https://www.pgpool.net/pipermail/pgpool-general/2024-October/001913.html When health_check_password is empty string, health check process looks for the password from pool_passwd file. Problem is, the file descriptor for the file is inherited from parent pgpool process. This means that pgpool main and health check process (possibly multiple process) share the same descriptor, which causes various problem including the issue reported here. To fix the problem, re-open the file when health check process starts so that each health check process owns its own file descriptor. Note that pgpool child process (responsible for frontend sessions) already re-opens the file descriptor and they are related to the issue. Problem reported and analyzed by Emond Papegaaij. Backpatch-through: v4.1 Discussion: https://www.pgpool.net/pipermail/pgpool-general/2024-October/001913.html
1 parent 6b71538 commit ec6740f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/health_check.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,14 @@ do_health_check_child(int *node_id)
154154
/* Initialize per process context */
155155
pool_init_process_context();
156156

157+
/*
158+
* Open pool_passwd.
159+
*/
160+
if (strcmp("", pool_config->pool_passwd))
161+
{
162+
pool_reopen_passwd_file();
163+
}
164+
157165
if (sigsetjmp(local_sigjmp_buf, 1) != 0)
158166
{
159167
pool_signal(SIGALRM, SIG_IGN);

0 commit comments

Comments
 (0)