Jason, thanks for pointing to problem, because it is really there. But honestly, I don't like your patch, because it changes totemsrp in very invasive way. I've created different patch, so please try to think about it and test, if it solves your problem. Regards, Honza diff --git a/exec/service.c b/exec/service.c index 03dc881..c88ba77 100644 --- a/exec/service.c +++ b/exec/service.c @@ -581,9 +581,10 @@ static int service_unlink_schedwrk_handler (const void *data) { /* * Exit all ipc connections dependent on this service */ - if (coroipcs_ipc_service_exit (cb_data->service_engine) == -1) + if (coroipcs_ipc_service_exit (cb_data->service_engine) == -1) { + totempg_event_signal(0,0); return -1; - + } log_printf(LOGSYS_LEVEL_NOTICE, "Service engine unloaded: %s\n", ais_service[cb_data->service_engine]->name); jason napsal(a): > Hi All, > According to coroipcs_ipc_service_exit(), one token round is needed for a > service to release its one IPC connection. By default configuration, one > token round needs 200ms when there is not any messages to send(no one > triggers token_hold_cancel_send()). So if there are a lot of IPC > connections belongs to a service, it will spends quite a long time to > unload this service. > In my test environment, CLM service have 100 IPC connections, so it spends > about 20 seconds to release all of them. > The solution is let token_callbacks_execute() to call > token_hold_cancel_send() under this circumstances. The following is the > patch: > diff -ruNp corosync-1.4.5-orig/exec/service.c corosync-1.4.5/exec/service.c > --- corosync-1.4.5-orig/exec/service.c 2012-12-12 18:47:52.000000000 +0800 > +++ corosync-1.4.5/exec/service.c 2013-05-20 22:53:04.496467600 +0800 > @@ -568,10 +568,11 @@ static int service_unlink_schedwrk_handl > struct corosync_api_v1 *api = (struct corosync_api_v1 > *)cb_data->api; > /* > - * Exit all ipc connections dependent on this service > + * Exit all ipc connections dependent on this service. > + * Return -2 will triggers token_hold_cancel_send() to make > unloading much faster. > */ > if (coroipcs_ipc_service_exit (cb_data->service_engine) == -1) > - return -1; > + return -2; > log_printf(LOGSYS_LEVEL_NOTICE, > "Service engine unloaded: %s\n", > diff -ruNp corosync-1.4.5-orig/exec/totemsrp.c > corosync-1.4.5/exec/totemsrp.c > --- corosync-1.4.5-orig/exec/totemsrp.c 2012-12-12 18:47:52.000000000 +0800 > +++ corosync-1.4.5/exec/totemsrp.c 2013-05-20 22:44:51.673387100 +0800 > @@ -3349,8 +3349,11 @@ static void token_callbacks_execute ( > /* > * This callback failed to execute, try it again on the > next token > */ > - if (res == -1 && del == 1) { > + if (res < 0 && del == 1) { > list_add (list, callback_listhead); > + if (res < -1) { > + token_hold_cancel_send (instance); > + } > } else if (del) { > free (token_callback_instance); > } > > > > _______________________________________________ > discuss mailing list > discuss@xxxxxxxxxxxx > http://lists.corosync.org/mailman/listinfo/discuss > _______________________________________________ discuss mailing list discuss@xxxxxxxxxxxx http://lists.corosync.org/mailman/listinfo/discuss