gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] 137/324: mq: Make %suspicious-length a sort-of exported


From: gnunet
Subject: [gnunet-scheme] 137/324: mq: Make %suspicious-length a sort-of exported parameter.
Date: Tue, 21 Sep 2021 13:22:57 +0200

This is an automated email from the git hooks/post-receive script.

maxime-devos pushed a commit to branch master
in repository gnunet-scheme.

commit 96da4cf04908461173c4002ce3fe399f26584cfb
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Tue Jun 15 20:16:58 2021 +0200

    mq: Make %suspicious-length a sort-of exported parameter.
    
    Tweaking %suspicious-length will be useful for a test
    case.
    
    * gnu/packages/mq.scm
      (%suspicious-length): Make this a parameter.
      (send-message!): Adjust to use %suspicious-length as a parameter.
      Only evaluate (%suspicious-length) once (could be important in
      case of weird usage of system-async-mark?).
---
 gnu/gnunet/mq.scm | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/gnu/gnunet/mq.scm b/gnu/gnunet/mq.scm
index 94b13b7..ef25cb3 100644
--- a/gnu/gnunet/mq.scm
+++ b/gnu/gnunet/mq.scm
@@ -40,7 +40,11 @@
          missing-header-error? missing-header-error-received-size
          &size-mismatch-error make-size-mismatch-error
          size-mismatch-error? size-mismatch-error-expected-size
-         size-mismatch-error-received-size)
+         size-mismatch-error-received-size
+
+         ;; Can be adjusted for debugging -- no guarantees it
+         ;; will not be removed!
+         %suspicious-length)
   (import (gnu gnunet mq handler)
          (gnu gnunet mq envelope)
          (gnu gnunet utils hat-let)
@@ -67,6 +71,7 @@
                raise raise-continuable)
          (only (rnrs records syntactic) define-record-type)
          (only (srfi srfi-8) receive)
+         (only (srfi srfi-39) make-parameter)
          (prefix (only (pfds queues)
                        make-queue dequeue enqueue queue-length
                        queue-empty?)
@@ -225,7 +230,8 @@ of message queues."
       (current-length  overly-full-queue-length)
       (suspicious-when overly-full-queue-suspicious-when))
 
-    (define %suspicious-length 10000)
+    (define %suspicious-length
+      (make-parameter 10000))
 
     (define* (send-message! mq message #:key (priority 0)
                            (notify-sent! values))
@@ -267,13 +273,14 @@ will be called."
         ;; The C implementation emits a warning if the queue has
         ;; many entries, as this may indicate a bug (in the scheduler,
         ;; in the queue implementation, ...). This seems a good idea.
-        (when (>= queue-length %suspicious-length)
-          (raise-continuable
-           (condition (make-overly-full-queue-warning
-                       queue-length %suspicious-length)
-                      ;; TODO: consider
-                      ;; (@ (gnu gnunet mq) send!) here and elsewhere.
-                      (make-who-condition 'send!))))
+        (let ((suspicious-length (%suspicious-length)))
+          (when (>= queue-length suspicious-length)
+            (raise-continuable
+             (condition (make-overly-full-queue-warning
+                         queue-length suspicious-length)
+                        ;; TODO: consider
+                        ;; (@ (gnu gnunet mq) send!) here and elsewhere.
+                        (make-who-condition 'send!)))))
         (try-send-again! mq))))
 
     (define (try-send-again! mq)

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]