File tree Expand file tree Collapse file tree 3 files changed +28
-5
lines changed Expand file tree Collapse file tree 3 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -67,12 +67,10 @@ static int reconnect_msec = 1000;
6767static GMainLoop * mainloop = NULL ;
6868static guint notify_timer = 0 ;
6969static crm_cluster_t cluster ;
70+ static void clean_up (int rc );
7071static gboolean sbd_remote_check (gpointer user_data );
7172static long unsigned int find_pacemaker_remote (void );
7273static void sbd_membership_destroy (gpointer user_data );
73- #if CHECK_TWO_NODE
74- static void cmap_destroy (void );
75- #endif
7674
7775
7876#if SUPPORT_PLUGIN
@@ -190,9 +188,9 @@ cmap_dispatch_callback (gint cmap_fd,
190188 /* CMAP connection lost */
191189 if (condition & G_IO_HUP ) {
192190 cl_log (LOG_WARNING , "CMAP service connection lost\n" );
193- cmap_destroy ( );
191+ clean_up ( EXIT_CLUSTER_DISCONNECT );
194192 /* remove the source from the main loop */
195- return G_SOURCE_REMOVE ;
193+ return G_SOURCE_REMOVE ; /* never reached */
196194 }
197195 cmap_dispatch (cmap_handle , CS_DISPATCH_ALL );
198196 return G_SOURCE_CONTINUE ;
@@ -557,6 +555,14 @@ find_pacemaker_remote(void)
557555static void
558556clean_up (int rc )
559557{
558+ #if SUPPORT_COROSYNC && CHECK_TWO_NODE
559+ cmap_destroy ();
560+ #endif
561+
562+ if (rc >= 0 ) {
563+ exit (rc );
564+ }
565+
560566 return ;
561567}
562568
Original file line number Diff line number Diff line change @@ -526,6 +526,20 @@ void inquisitor_child(void)
526526 break ;
527527 }
528528 }
529+ } else if (sbd_is_cluster (s )) {
530+ if (WIFEXITED (status )) {
531+ switch (WEXITSTATUS (status )) {
532+ case EXIT_CLUSTER_DISCONNECT :
533+ cl_log (LOG_WARNING , "Cluster-Servant has exited (connection lost)" );
534+ s -> restarts = 0 ;
535+ s -> restart_blocked = 0 ;
536+ s -> outdated = 1 ;
537+ s -> t_last .tv_sec = 0 ;
538+ break ;
539+ default :
540+ break ;
541+ }
542+ }
529543 }
530544 cleanup_servant_by_pid (pid );
531545 }
Original file line number Diff line number Diff line change 6262/* exit status for pcmk-servant */
6363#define EXIT_PCMK_SERVANT_GRACEFUL_SHUTDOWN 30
6464
65+ /* exit status for cluster-servant */
66+ #define EXIT_CLUSTER_DISCONNECT 40
67+
6568#define HOG_CHAR 0xff
6669#define SECTOR_NAME_MAX 63
6770
You can’t perform that action at this time.
0 commit comments