ASF Bugzilla – Attachment 20925 Details for
Bug 43359
trunk EventMPM's graceful restart/stop are not graceful
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
[incomplete] listener thread stop only listening
event-graceful.patch (text/plain), 3.42 KB, created by
Takashi Sato
on 2007-10-05 09:56:11 UTC
(
hide
)
Description:
[incomplete] listener thread stop only listening
Filename:
MIME Type:
Creator:
Takashi Sato
Created:
2007-10-05 09:56:11 UTC
Size:
3.42 KB
patch
obsolete
>Index: trunk/server/mpm/experimental/event/event.c >=================================================================== >--- trunk/server/mpm/experimental/event/event.c (revision 582289) >+++ trunk/server/mpm/experimental/event/event.c (working copy) >@@ -885,6 +885,29 @@ > } > } > >+static void close_listeners(int process_slot, int *closed){ >+ if(!*closed){ >+ ap_listen_rec *lr; >+ int i; >+ for (lr = ap_listeners; lr != NULL; lr = lr->next) { >+ apr_pollfd_t *pfd = apr_pcalloc(pchild, sizeof(*pfd)); >+ pfd->desc_type = APR_POLL_SOCKET; >+ pfd->desc.s = lr->sd; >+ apr_pollset_remove(event_pollset, pfd); >+ } >+ ap_close_listeners(); >+ *closed = 1; >+ dying = 1; >+ ap_scoreboard_image->parent[process_slot].quiescing = 1; >+ for(i = 0; i < ap_threads_per_child; ++i){ >+ ap_update_child_status_from_indexes(process_slot, i, >+ SERVER_DEAD, NULL); >+ } >+ /* wake up the main thread */ >+ kill(ap_my_pid, SIGTERM); >+ } >+} >+ > static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy) > { > apr_status_t rc; >@@ -902,6 +925,7 @@ > apr_interval_time_t timeout_interval; > apr_time_t timeout_time; > listener_poll_type *pt; >+ int closed = 0; > > free(ti); > >@@ -935,7 +959,12 @@ > unblock_signal(LISTENER_SIGNAL); > apr_signal(LISTENER_SIGNAL, dummy_signal_handler); > >- while (!listener_may_exit) { >+ for(;;) { >+ if(listener_may_exit){ >+ close_listeners(process_slot, &closed); >+ if(terminate_mode == ST_UNGRACEFUL) >+ break; >+ } > > if (requests_this_child <= 0) { > check_infinite_requests(); >@@ -956,8 +985,11 @@ > } > } > >- if (listener_may_exit) >- break; >+ if(listener_may_exit){ >+ close_listeners(process_slot, &closed); >+ if(terminate_mode == ST_UNGRACEFUL) >+ break; >+ } > > while (num && get_worker(&have_idle_worker)) { > pt = (listener_poll_type *) out_pfd->client_data; >@@ -1128,14 +1160,9 @@ > > } /* listener main loop */ > >- ap_close_listeners(); >+ close_listeners(process_slot, &closed); > ap_queue_term(worker_queue); >- dying = 1; >- ap_scoreboard_image->parent[process_slot].quiescing = 1; > >- /* wake up the main thread */ >- kill(ap_my_pid, SIGTERM); >- > apr_thread_exit(thd, APR_SUCCESS); > return NULL; > } >@@ -1180,7 +1207,7 @@ > } > > ap_update_child_status_from_indexes(process_slot, thread_slot, >- SERVER_READY, NULL); >+ dying ? SERVER_DEAD : SERVER_READY, NULL); > worker_pop: > if (workers_may_exit) { > break; >@@ -1565,7 +1592,7 @@ > * If the worker hasn't exited, then this blocks until > * they have (then cleans up). > */ >- join_workers(ts->listener, threads); >+ join_workers(NULL, threads); > } > else { /* !one_process */ > /* remove SIGTERM from the set of blocked signals... if one of >@@ -1606,7 +1633,7 @@ > * If the worker hasn't exited, then this blocks until > * they have (then cleans up). > */ >- join_workers(ts->listener, threads); >+ join_workers(NULL, threads); > } > > free(threads);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 43359
:
20925
|
20932
|
20941
|
20950