diff options
| author | Tatsuo Ishii | 2025-06-14 11:54:13 +0000 |
|---|---|---|
| committer | Tatsuo Ishii | 2025-06-14 11:54:13 +0000 |
| commit | 9fc568f00cebda8a6908c19fb6ab247e497686fe (patch) | |
| tree | 26bdc05e13eb6a94fcc0df16b275ed8e245d54cd | |
| parent | e5564eb541af139fe825e1563e3ca0a6d522553c (diff) | |
Enhance lifecheck log.
Previously when wd_lifecheck_method = 'query', life checking prints
SQL without application name if "%a" is specified in
log_line_prefix. This commit add application_name "lifecheck_ping" to
make the log looks better. Since this changes user visible behavior,
I do not apply this to stable branches.
Discussion: [pgpool-hackers: 4603] life check log is not nice
https://www.pgpool.net/pipermail/pgpool-hackers/2025-June/004604.html
| -rw-r--r-- | src/watchdog/wd_lifecheck.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/watchdog/wd_lifecheck.c b/src/watchdog/wd_lifecheck.c index c399128b4..ce99a4000 100644 --- a/src/watchdog/wd_lifecheck.c +++ b/src/watchdog/wd_lifecheck.c @@ -6,7 +6,7 @@ * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * - * Copyright (c) 2003-2022 PgPool Global Development Group + * Copyright (c) 2003-2025 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby @@ -943,13 +943,15 @@ create_conn(char *hostname, int port, char *password) } snprintf(conninfo, sizeof(conninfo), - "host='%s' port='%d' dbname='%s' user='%s' password='%s' connect_timeout='%d'", + "host='%s' port='%d' dbname='%s' user='%s' password='%s' connect_timeout='%d' application_name='%s'", hostname, port, pool_config->wd_lifecheck_dbname, pool_config->wd_lifecheck_user, password ? password : "", - pool_config->wd_interval / 2 + 1); + pool_config->wd_interval / 2 + 1, + "lifecheck_ping"); + conn = PQconnectdb(conninfo); if (PQstatus(conn) != CONNECTION_OK) |
