]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix #305: only wake up thread when threshold reached.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 23 Sep 2020 11:20:25 +0000 (13:20 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 23 Sep 2020 11:20:25 +0000 (13:20 +0200)
dnstap/dtstream.c
doc/Changelog

index b0586d1ba8dc223e2a927aff915fcefb8fe74ab6..b0918c52cc637ab8e4332827f389afd4a4d530f9 100644 (file)
@@ -258,8 +258,9 @@ dt_msg_queue_submit(struct dt_msg_queue* mq, void* buf, size_t len)
                wakeupstarttimer = 1;
        /* if list contains more than wakeupnum elements, wakeup now,
         * or if list is (going to be) almost full */
-       if(mq->msgcount+1 > DTIO_MSG_FOR_WAKEUP ||
-               mq->cursize+len >= mq->maxsize * 9 / 10)
+       if(mq->msgcount == DTIO_MSG_FOR_WAKEUP ||
+               (mq->cursize < mq->maxsize * 9 / 10 &&
+               mq->cursize+len >= mq->maxsize * 9 / 10))
                wakeupnow = 1;
        /* see if it is going to fit */
        if(mq->cursize + len > mq->maxsize) {
index e316ea99f9c46ddd36f35157930f5dd6d67f78b1..4cd9a8e788af68e8e349d792a403565d9f4aea25 100644 (file)
@@ -1,6 +1,7 @@
 23 September 2020: Wouter
        - Fix #305: dnstap logging significantly affects unbound performance
          (regression in 1.11).
+       - Fix #305: only wake up thread when threshold reached.
 
 23 September 2020: Ralph
        - Fix edns-client-tags get_option typo