Просмотр исходного кода

Periodically check_ntp_time return "Socket timeout" when one of

several ntp server doesn't response

Fix for issue #150

Thanks to Leonid Vasiliev for the patch. We may want to make a
better fix at some point, but this should do the job for now.
John C. Frickson 8 лет назад
Родитель
Сommit
0d66309f18
3 измененных файлов с 5 добавлено и 0 удалено
  1. 1 0
      NEWS
  2. 1 0
      THANKS.in
  3. 3 0
      plugins/check_ntp_time.c

+ 1 - 0
NEWS

@@ -3,6 +3,7 @@ This file documents the major additions and syntax changes between releases.
 2.2.2 xxxx-xx-xx
 	FIXES
 	check_disk: autofs being mounted despite '-l'. Fixed, and also excluded some system "fake" mountpoints
+	check_ntp_time: Periodically returns "Socket timeout" when one of several ntp server doesn't respond
 
 
 2.2.1 xxxx-xx-xx

+ 1 - 0
THANKS.in

@@ -200,6 +200,7 @@ Lars Stavholm
 Lars Vogdt
 Laurent Licour
 Laurent Vaslin
+Leonid Vasiliev
 Lionel Cons
 Lonny Selinger
 Luca Corti

+ 3 - 0
plugins/check_ntp_time.c

@@ -413,6 +413,9 @@ double offset_request(const char *host, int *status){
 			}
 		}
 		/* lather, rinse, repeat. */
+		/* break if we have one response but other ntp servers doesn't response */
+		/* greater than timeout_interval/2 */
+		if (servers_completed && now_time-start_ts > timeout_interval/2) break;
 	}
 
 	if (one_read == 0) {