]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ntpd.c:
authorFrank Kardel <kardel@ntp.org>
Sun, 17 Feb 2008 08:38:07 +0000 (08:38 +0000)
committerFrank Kardel <kardel@ntp.org>
Sun, 17 Feb 2008 08:38:07 +0000 (08:38 +0000)
  Bug 1000: avoid timer() starvation during high load conditions
ChangeLog:
  Bug 1000: additionally fix timer() starvation during high load

bk: 47b7f26fO1WZPiVElSf7HPD28BwH3Q

ChangeLog
ntpd/ntpd.c

index 5200f65d417c0f2a2dd9b814dd1a0b834c0ea853..e003139936917bbe4adecb71c480e9ce286c5727 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 * [Bug 1000] allow implicit receive buffer allocation for Windows
             fixes startup for windows systems with many interfaces
             reduces dropped packets on network bursts
+            additionally fix timer() starvation during high load
 ---
 (4.2.4p4) Released by Harlan Stenn <stenn@ntp.org>
 
index b894e71f82c29dc01305ad6960d6102dfb713080..04e0d07f94c90b71a7d65e3d9e3a5175ce67ff34 100644 (file)
@@ -1085,8 +1085,19 @@ getgroup:
                        rbuf = get_full_recv_buffer();
                        while (rbuf != NULL)
                        {
+                               if (alarm_flag)
+                               {
+                                       was_alarmed = 1;
+                                       alarm_flag = 0;
+                               }
                                UNBLOCK_IO_AND_ALARM();
 
+                               if (was_alarmed)
+                               {       /* avoid timer starvation during lengthy I/O handling */
+                                       timer();
+                                       was_alarmed = 0;
+                               }
+
                                /*
                                 * Call the data procedure to handle each received
                                 * packet.