| 881 | |
| 882 | |
| 883 | static void timer_process_graceful_terminate(int sender, void *param) |
| 884 | { |
| 885 | /* we accept this only from the main proccess */ |
| 886 | if (sender!=0) { |
| 887 | LM_BUG("graceful terminate received from a non-main process!!\n"); |
| 888 | return; |
| 889 | } |
| 890 | LM_NOTICE("process %d received RPC to terminate from Main\n",process_no); |
| 891 | |
| 892 | /*remove from reactor all the shared fds, so we stop reading from them */ |
| 893 | |
| 894 | /*remove timer jobs pipe */ |
| 895 | reactor_del_reader( timer_fd_out, -1, 0); |
| 896 | |
| 897 | /*remove private IPC pipe */ |
| 898 | reactor_del_reader( IPC_FD_READ_SELF, -1, 0); |
| 899 | |
| 900 | /* let's drain the private IPC */ |
| 901 | ipc_handle_all_pending_jobs(IPC_FD_READ_SELF); |
| 902 | |
| 903 | /* what is left now is the reactor are async fd's, so we need to |
| 904 | * wait to complete all of them */ |
| 905 | if (reactor_is_empty()) |
| 906 | dynamic_process_final_exit(); |
| 907 | |
| 908 | /* the exit will be triggered by the reactor, when empty */ |
| 909 | _termination_in_progress = 1; |
| 910 | LM_WARN("reactor not empty, waiting for pending async\n"); |
| 911 | } |
| 912 | |
| 913 | |
| 914 | int start_timer_extra_processes(int *chd_rank) |
nothing calls this directly
no test coverage detected