* pgpool: a language independent connection pool server for PostgreSQL
* written by Tatsuo Ishii
*
- * Copyright (c) 2003-2020 PgPool Global Development Group
+ * Copyright (c) 2003-2022 PgPool Global Development Group
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby
ereport(DEBUG2,
(errmsg("I am Pgpool Child process with pid: %d", getpid())));
- ProcessInfo* proc_info = pool_get_process_info(getpid());
-
/* Identify myself via ps */
init_ps_display("", "", "", "");
if (pool_config->child_max_connections > 0)
connections_count++;
- proc_info->client_connection_count++;
+ pool_get_my_process_info()->client_connection_count++;
/* check if maximum connections count for this child reached */
if ((pool_config->child_max_connections > 0) &&
pool_session_context_destroy();
front_end_fd = wait_for_new_connections(fds, &saddr);
- proc_info->wait_for_connect = 0;
+ pool_get_my_process_info()->wait_for_connect = 0;
if (front_end_fd == OPERATION_TIMEOUT)
{
- if (pool_config->child_life_time > 0 && proc_info->connected)
+ if (pool_config->child_life_time > 0 && pool_get_my_process_info()->connected)
{
ereport(DEBUG1,
(errmsg("child life %d seconds expired", pool_config->child_life_time)));
child_frontend = NULL;
continue;
}
- proc_info->connected = 1;
+ pool_get_my_process_info()->connected = 1;
/*
* show ps status
if (pool_config->child_max_connections > 0)
connections_count++;
- proc_info->client_connection_count++;
+ pool_get_my_process_info()->client_connection_count++;
/* check if maximum connections count for this child reached */
if ((pool_config->child_max_connections > 0) &&
struct timeval *timeout;
struct timeval timeoutdata;
- ProcessInfo* proc_info = pool_get_process_info(getpid());
-
for (walk = fds; *walk != -1; walk++)
socket_set_nonblock(*walk);
break;
/* timeout */
- proc_info->wait_for_connect++;
+ pool_get_my_process_info()->wait_for_connect++;
- if (proc_info->wait_for_connect > pool_config->child_life_time)
+ if (pool_get_my_process_info()->wait_for_connect > pool_config->child_life_time)
return OPERATION_TIMEOUT;
}
void
set_process_status(ProcessStatus status)
{
- ProcessInfo* proc_info = pool_get_process_info(getpid());
- proc_info->status = status;
+ pool_get_my_process_info()->status = status;
}