MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / timer_process_graceful_terminate

Function timer_process_graceful_terminate

timer.c:883–911  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

881
882
883static 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
914int start_timer_extra_processes(int *chd_rank)

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected