Chris Browne cbbrowne at lists.slony.info
Fri Aug 1 12:49:41 PDT 2008
Update of /home/cvsd/slony1/slony1-engine/src/slon
In directory main.slony.info:/tmp/cvs-serv23657

Modified Files:
	slon.c 
Log Message:
a) Make slon_terminate_worker() visible so that remote_worker.c can
   reference it

b) Revise various logging that used SLON_DEBUG1 and SLON_DEBUG2 to 
   instead log at SLON_INFO and SLON_CONFIG levels


Index: slon.c
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/slon/slon.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -C2 -d -r1.77 -r1.78
*** slon.c	3 Jan 2008 15:47:21 -0000	1.77
--- slon.c	1 Aug 2008 19:49:39 -0000	1.78
***************
*** 76,80 ****
  static void SlonWatchdog(void);
  static void sighandler(int signo);
! static void slon_terminate_worker(void);
  #endif
  
--- 76,80 ----
  static void SlonWatchdog(void);
  static void sighandler(int signo);
! void slon_terminate_worker(void);
  #endif
  
***************
*** 658,662 ****
  	PQclear(res);
  	dstring_free(&query);
! 	slon_log(SLON_DEBUG2,
  			 "main: last local event sequence = %s\n",
  			 rtcfg_lastevent);
--- 658,662 ----
  	PQclear(res);
  	dstring_free(&query);
! 	slon_log(SLON_CONFIG,
  			 "main: last local event sequence = %s\n",
  			 rtcfg_lastevent);
***************
*** 737,741 ****
  	 * Wait until the scheduler has shut down all remote connections
  	 */
! 	slon_log(SLON_DEBUG1, "main: running scheduler mainloop\n");
  	if (sched_wait_mainloop() < 0)
  	{
--- 737,741 ----
  	 * Wait until the scheduler has shut down all remote connections
  	 */
! 	slon_log(SLON_INFO, "main: running scheduler mainloop\n");
  	if (sched_wait_mainloop() < 0)
  	{
***************
*** 743,747 ****
  		slon_retry();
  	}
! 	slon_log(SLON_DEBUG1, "main: scheduler mainloop returned\n");
  
  	/*
--- 743,747 ----
  		slon_retry();
  	}
! 	slon_log(SLON_INFO, "main: scheduler mainloop returned\n");
  
  	/*
***************
*** 750,754 ****
  	main_thread = pthread_self();
  
! 	slon_log(SLON_DEBUG2, "main: wait for remote threads\n");
  	rtcfg_joinAllRemoteThreads();
  
--- 750,754 ----
  	main_thread = pthread_self();
  
! 	slon_log(SLON_CONFIG, "main: wait for remote threads\n");
  	rtcfg_joinAllRemoteThreads();
  
***************
*** 774,778 ****
  #endif
  
! 	slon_log(SLON_DEBUG1, "main: done\n");
  
  	exit(0);
--- 774,778 ----
  #endif
  
! 	slon_log(SLON_CONFIG, "main: done\n");
  
  	exit(0);
***************
*** 858,864 ****
  			continue;
  
! 		slon_log(SLON_DEBUG2, "slon: child terminated status: %d; pid: %d, current worker pid: %d\n", child_status, pid, slon_worker_pid);
  	}
! 	slon_log(SLON_DEBUG2, "slon: child terminated status: %d; pid: %d, current worker pid: %d\n", child_status, pid, slon_worker_pid);
  
  	(void) alarm(0);
--- 858,864 ----
  			continue;
  
! 		slon_log(SLON_CONFIG, "slon: child terminated status: %d; pid: %d, current worker pid: %d\n", child_status, pid, slon_worker_pid);
  	}
! 	slon_log(SLON_CONFIG, "slon: child terminated status: %d; pid: %d, current worker pid: %d\n", child_status, pid, slon_worker_pid);
  
  	(void) alarm(0);
***************
*** 878,887 ****
  			if (child_status != 0)
  			{
! 				slon_log(SLON_DEBUG1, "slon: restart of worker in 10 seconds\n");
  				(void) sleep(10);
  			}
  			else
  			{
! 				slon_log(SLON_DEBUG1, "slon: restart of worker\n");
  			}
  			if (watchdog_status == SLON_WATCHDOG_RETRY)
--- 878,887 ----
  			if (child_status != 0)
  			{
! 				slon_log(SLON_CONFIG, "slon: restart of worker in 10 seconds\n");
  				(void) sleep(10);
  			}
  			else
  			{
! 				slon_log(SLON_CONFIG, "slon: restart of worker\n");
  			}
  			if (watchdog_status == SLON_WATCHDOG_RETRY)
***************
*** 898,902 ****
  	}
  
! 	slon_log(SLON_DEBUG1, "slon: done\n");
  
  	/*
--- 898,902 ----
  	}
  
! 	slon_log(SLON_INFO, "slon: done\n");
  
  	/*
***************
*** 917,921 ****
  	{
  		case SIGALRM:
! 			slon_log(SLON_DEBUG1, "slon: child termination timeout - kill child\n");
  			kill(slon_worker_pid, SIGKILL);
  			break;
--- 917,921 ----
  	{
  		case SIGALRM:
! 			slon_log(SLON_INFO, "slon: child termination timeout - kill child\n");
  			kill(slon_worker_pid, SIGKILL);
  			break;
***************
*** 925,929 ****
  
  		case SIGHUP:
! 			slon_log(SLON_DEBUG1, "slon: restart requested\n");
  			watchdog_status = SLON_WATCHDOG_RESTART;
  			slon_terminate_worker();
--- 925,929 ----
  
  		case SIGHUP:
! 			slon_log(SLON_INFO, "slon: restart requested\n");
  			watchdog_status = SLON_WATCHDOG_RESTART;
  			slon_terminate_worker();
***************
*** 931,935 ****
  
  		case SIGUSR1:
! 			slon_log(SLON_DEBUG1, "slon: retry requested\n");
  			watchdog_status = SLON_WATCHDOG_RETRY;
  			slon_terminate_worker();
--- 931,935 ----
  
  		case SIGUSR1:
! 			slon_log(SLON_INFO, "slon: retry requested\n");
  			watchdog_status = SLON_WATCHDOG_RETRY;
  			slon_terminate_worker();
***************
*** 938,942 ****
  		case SIGINT:
  		case SIGTERM:
! 			slon_log(SLON_DEBUG1, "slon: shutdown requested\n");
  			watchdog_status = SLON_WATCHDOG_SHUTDOWN;
  			slon_terminate_worker();
--- 938,942 ----
  		case SIGINT:
  		case SIGTERM:
! 			slon_log(SLON_INFO, "slon: shutdown requested\n");
  			watchdog_status = SLON_WATCHDOG_SHUTDOWN;
  			slon_terminate_worker();
***************
*** 944,948 ****
  
  		case SIGQUIT:
! 			slon_log(SLON_DEBUG1, "slon: shutdown now requested\n");
  			kill(slon_worker_pid, SIGKILL);
  			slon_exit(-1);
--- 944,948 ----
  
  		case SIGQUIT:
! 			slon_log(SLON_INFO, "slon: shutdown now requested\n");
  			kill(slon_worker_pid, SIGKILL);
  			slon_exit(-1);
***************
*** 958,962 ****
  slon_terminate_worker()
  {
! 	slon_log(SLON_DEBUG2, "slon: notify worker process to shutdown\n");
  
  	if (pipewrite(sched_wakeuppipe[1], "p", 1) != 1)
--- 958,962 ----
  slon_terminate_worker()
  {
! 	slon_log(SLON_INFO, "slon: notify worker process to shutdown\n");
  
  	if (pipewrite(sched_wakeuppipe[1], "p", 1) != 1)



More information about the Slony1-commit mailing list