}
ap_log_error(APLOG_MARK, APLOG_INFO, 0, ap_server_conf,
- "Child %d: Accept thread listening on %s:%d using %s", my_pid,
+ "Child: Accept thread listening on %s:%d using %s",
lr->bind_addr->hostname ? lr->bind_addr->hostname : "*",
lr->bind_addr->port, accf_name);
++err_count;
if (err_count > MAX_ACCEPTEX_ERR_COUNT) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf,
- "Child %d: Encountered too many AcceptEx "
+ "Child: Encountered too many AcceptEx "
"faults accepting client connections. "
"Possible causes: dynamic address renewal, "
- "or incompatible VPN or firewall software. ",
- my_pid);
+ "or incompatible VPN or firewall software. ");
ap_log_error(APLOG_MARK, APLOG_NOTICE, rv, ap_server_conf,
"winnt_mpm: falling back to "
"'AcceptFilter none'.");
++err_count;
if (err_count > MAX_ACCEPTEX_ERR_COUNT) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf,
- "Child %d: Encountered too many AcceptEx "
- "faults accepting client connections.",
- my_pid);
+ "Child: Encountered too many AcceptEx "
+ "faults accepting client connections.");
ap_log_error(APLOG_MARK, APLOG_NOTICE, rv, ap_server_conf,
"winnt_mpm: falling back to "
"'AcceptFilter none'.");
++err_count;
if (err_count > MAX_ACCEPTEX_ERR_COUNT) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf,
- "Child %d: Encountered too many accept() "
- "resource faults, aborting.",
- my_pid);
+ "Child: Encountered too many accept() "
+ "resource faults, aborting.");
break;
}
continue;
}
ap_log_error(APLOG_MARK, APLOG_INFO, APR_SUCCESS, ap_server_conf,
- "Child %d: Accept thread exiting.", my_pid);
+ "Child: Accept thread exiting.");
return 0;
}
if (!rc) {
rc = apr_get_os_error();
ap_log_error(APLOG_MARK, APLOG_DEBUG, rc, ap_server_conf,
- "Child %d: GetQueuedComplationStatus returned %d",
- my_pid, rc);
+ "Child: GetQueuedComplationStatus returned %d",
+ rc);
continue;
}
max_requests_per_child_event = CreateEvent(NULL, TRUE, FALSE, NULL);
if (!max_requests_per_child_event) {
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf,
- "Child %d: Failed to create a max_requests event.",
- my_pid);
+ "Child: Failed to create a max_requests event.");
exit(APEXIT_CHILDINIT);
}
child_events[0] = exit_event;
status = apr_proc_mutex_lock(start_mutex);
if (status != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, status, ap_server_conf,
- "Child %d: Failed to acquire the start_mutex. "
- "Process will exit.", my_pid);
+ "Child: Failed to acquire the start_mutex. "
+ "Process will exit.");
exit(APEXIT_CHILDINIT);
}
ap_log_error(APLOG_MARK, APLOG_NOTICE, APR_SUCCESS, ap_server_conf,
- "Child %d: Acquired the start mutex.", my_pid);
+ "Child: Acquired the start mutex.");
/*
* Create the worker thread dispatch IOCompletionPort
if (!qwait_event) {
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(),
ap_server_conf,
- "Child %d: Failed to create a qwait event.", my_pid);
+ "Child: Failed to create a qwait event.");
exit(APEXIT_CHILDINIT);
}
* Create the pool of worker threads
*/
ap_log_error(APLOG_MARK, APLOG_NOTICE, APR_SUCCESS, ap_server_conf,
- "Child %d: Starting %d worker threads.",
- my_pid, ap_threads_per_child);
+ "Child: Starting %d worker threads.", ap_threads_per_child);
child_handles = (HANDLE) apr_pcalloc(pchild, ap_threads_per_child
* sizeof(HANDLE));
apr_thread_mutex_create(&child_lock, APR_THREAD_MUTEX_DEFAULT, pchild);
if (child_handles[i] == 0) {
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(),
ap_server_conf,
- "Child %d: CreateThread failed. Unable to "
+ "Child: CreateThread failed. Unable to "
"create all worker threads. Created %d of the %d "
"threads requested with the ThreadsPerChild "
"configuration directive.",
- my_pid, threads_created, ap_threads_per_child);
+ threads_created, ap_threads_per_child);
ap_signal_parent(SIGNAL_PARENT_SHUTDOWN);
goto shutdown;
}
/* Something serious is wrong */
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(),
ap_server_conf,
- "Child %d: WAIT_FAILED -- shutting down server",
- my_pid);
+ "Child: WAIT_FAILED -- shutting down server");
break;
}
else if (cld == 0) {
/* Exit event was signaled */
ap_log_error(APLOG_MARK, APLOG_NOTICE, APR_SUCCESS, ap_server_conf,
- "Child %d: Exit event signaled. Child process is "
- "ending.", my_pid);
+ "Child: Exit event signaled. Child process is "
+ "ending.");
break;
}
else {
* Signal the parent to restart
*/
ap_log_error(APLOG_MARK, APLOG_NOTICE, APR_SUCCESS, ap_server_conf,
- "Child %d: Process exiting because it reached "
+ "Child: Process exiting because it reached "
"MaxConnectionsPerChild. Signaling the parent to "
- "restart a new child process.", my_pid);
+ "restart a new child process.");
ap_signal_parent(SIGNAL_PARENT_RESTART);
break;
}
rv = apr_proc_mutex_unlock(start_mutex);
if (rv == APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_NOTICE, rv, ap_server_conf,
- "Child %d: Released the start mutex", my_pid);
+ "Child: Released the start mutex");
}
else {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf,
- "Child %d: Failure releasing the start mutex", my_pid);
+ "Child: Failure releasing the start mutex");
}
/* Shutdown the worker threads
*/
while (g_blocked_threads > 0) {
ap_log_error(APLOG_MARK, APLOG_INFO, APR_SUCCESS, ap_server_conf,
- "Child %d: %d threads blocked on the completion port",
- my_pid, g_blocked_threads);
+ "Child: %d threads blocked on the completion port",
+ g_blocked_threads);
for (i=g_blocked_threads; i > 0; i--) {
PostQueuedCompletionStatus(ThreadDispatchIOCP, 0,
IOCP_SHUTDOWN, NULL);
if ((time_remains % 30000) == 0) {
ap_log_error(APLOG_MARK, APLOG_NOTICE, APR_SUCCESS,
ap_server_conf,
- "Child %d: Waiting %d more seconds "
+ "Child: Waiting %d more seconds "
"for %d worker threads to finish.",
- my_pid, time_remains / 1000, threads_created);
+ time_remains / 1000, threads_created);
}
/* We'll poll from the top, 10 times per second */
Sleep(100);
/* Kill remaining threads off the hard way */
if (threads_created) {
ap_log_error(APLOG_MARK, APLOG_NOTICE, APR_SUCCESS, ap_server_conf,
- "Child %d: Terminating %d threads that failed to exit.",
- my_pid, threads_created);
+ "Child: Terminating %d threads that failed to exit.",
+ threads_created);
}
for (i = 0; i < threads_created; i++) {
int *score_idx;
}
}
ap_log_error(APLOG_MARK, APLOG_NOTICE, APR_SUCCESS, ap_server_conf,
- "Child %d: All worker threads have exited.", my_pid);
+ "Child: All worker threads have exited.");
apr_thread_mutex_destroy(child_lock);
apr_thread_mutex_destroy(qlock);
&BytesRead, (LPOVERLAPPED) NULL)
|| (BytesRead != sizeof(HANDLE))) {
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf,
- "Child %d: Unable to retrieve the ready event from the parent", my_pid);
+ "Child: Unable to retrieve the ready event from the parent");
exit(APEXIT_CHILDINIT);
}
&BytesRead, (LPOVERLAPPED) NULL)
|| (BytesRead != sizeof(HANDLE))) {
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf,
- "Child %d: Unable to retrieve the exit event from the parent", my_pid);
+ "Child: Unable to retrieve the exit event from the parent");
exit(APEXIT_CHILDINIT);
}
&BytesRead, (LPOVERLAPPED) NULL)
|| (BytesRead != sizeof(os_start))) {
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf,
- "Child %d: Unable to retrieve the start_mutex from the parent", my_pid);
+ "Child: Unable to retrieve the start_mutex from the parent");
exit(APEXIT_CHILDINIT);
}
*child_start_mutex = NULL;
if ((rv = apr_os_proc_mutex_put(child_start_mutex, &os_start, s->process->pool))
!= APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf,
- "Child %d: Unable to access the start_mutex from the parent", my_pid);
+ "Child: Unable to access the start_mutex from the parent");
exit(APEXIT_CHILDINIT);
}
&BytesRead, (LPOVERLAPPED) NULL)
|| (BytesRead != sizeof(hScore))) {
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf,
- "Child %d: Unable to retrieve the scoreboard from the parent", my_pid);
+ "Child: Unable to retrieve the scoreboard from the parent");
exit(APEXIT_CHILDINIT);
}
*scoreboard_shm = NULL;
if ((rv = apr_os_shm_put(scoreboard_shm, &hScore, s->process->pool))
!= APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf,
- "Child %d: Unable to access the scoreboard from the parent", my_pid);
+ "Child: Unable to access the scoreboard from the parent");
exit(APEXIT_CHILDINIT);
}
rv = ap_reopen_scoreboard(s->process->pool, scoreboard_shm, 1);
if (rv || !(sb_shared = apr_shm_baseaddr_get(*scoreboard_shm))) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf,
- "Child %d: Unable to reopen the scoreboard from the parent", my_pid);
+ "Child: Unable to reopen the scoreboard from the parent");
exit(APEXIT_CHILDINIT);
}
/* We must 'initialize' the scoreboard to relink all the
ap_init_scoreboard(sb_shared);
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
- "Child %d: Retrieved our scoreboard from the parent.", my_pid);
+ "Child: Retrieved our scoreboard from the parent.");
}
&WSAProtocolInfo, 0, 0);
if (nsd == INVALID_SOCKET) {
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_netos_error(), ap_server_conf,
- "Child %d: setup_inherited_listeners(), WSASocket failed to open the inherited socket.", my_pid);
+ "Child: setup_inherited_listeners(), WSASocket failed to open the inherited socket.");
exit(APEXIT_CHILDINIT);
}
}
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
- "Child %d: retrieved %d listeners from parent", my_pid, lcnt);
+ "Child: retrieved %d listeners from parent", lcnt);
}
APR_LOCK_DEFAULT, s->process->pool);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK,APLOG_ERR, rv, ap_server_conf,
- "%s child %d: Unable to init the start_mutex.",
- service_name, my_pid);
+ "%s child: Unable to init the start_mutex.",
+ service_name);
exit(APEXIT_CHILDINIT);
}
/* The child process or in one_process (debug) mode
*/
ap_log_error(APLOG_MARK, APLOG_NOTICE, APR_SUCCESS, ap_server_conf,
- "Child %d: Child process is running", my_pid);
+ "Child process is running");
child_main(pconf);
ap_log_error(APLOG_MARK, APLOG_NOTICE, APR_SUCCESS, ap_server_conf,
- "Child %d: Child process is exiting", my_pid);
+ "Child process is exiting");
return DONE;
}
else