[pgpool-general: 9236] Sporadic health check failures due to authentication failure

Emond Papegaaij emond.papegaaij at gmail.com
Wed Oct 23 20:38:22 JST 2024


Hi all,

Every now and then we see sporadic failures of health checks (see config
below) due to authentication failures. As these checks run every 5 seconds,
and the authentication does not change at all, these should either fail all
the time or never at all, so I suspect a race condition. I've checked the
code, and may have found the potential issue, but not being a very good c
programmer, I might be wrong.

In pool_get_user_credentials in pool_passwd.c (which it must reach because
health_check_password is empty), the password file is read via passwd_fd.
This file descriptor is rewound at line 362 (in 4.5.4). However, I wonder
what would happen if another process uses this same descriptor at the same
time. I suspect this might lead to one of the two processes (or maybe even
both) to get incorrect results.

health_check_period = 5
health_check_timeout = 20
health_check_user = 'keyhub'
health_check_password = ''
health_check_database = ''
health_check_max_retries = 0
health_check_retry_delay = 1

Best regards,
Emond
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pgpool.net/pipermail/pgpool-general/attachments/20241023/845d0806/attachment.htm>


More information about the pgpool-general mailing list