[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.
- [gnunet-scheme] 142/324: mq: Implement envelope cancellation callback., (continued)
- [gnunet-scheme] 142/324: mq: Implement envelope cancellation callback., gnunet, 2021/09/21
- [gnunet-scheme] 111/324: config: parser: Remove fixed TODO., gnunet, 2021/09/21
- [gnunet-scheme] 114/324: config: parser: More TODOs about the configuration format., gnunet, 2021/09/21
- [gnunet-scheme] 119/324: netstruct: Correct size of u8., gnunet, 2021/09/21
- [gnunet-scheme] 122/324: netstruct: Pass index for u8 (zero)., gnunet, 2021/09/21
- [gnunet-scheme] 123/324: netstruct: Select a part of the slice before trying to read., gnunet, 2021/09/21
- [gnunet-scheme] 124/324: netstruct: Use the correct size for bounds checking in 'select'., gnunet, 2021/09/21
- [gnunet-scheme] 130/324: mq: New module, replacing message-io., gnunet, 2021/09/21
- [gnunet-scheme] 132/324: mq: Do not hardcode suspicious queue length., gnunet, 2021/09/21
- [gnunet-scheme] 133/324: mq: Pluralise ‘message-queue-handler’., gnunet, 2021/09/21
- [gnunet-scheme] 137/324: mq: Make %suspicious-length a sort-of exported parameter.,
gnunet <=
- [gnunet-scheme] 139/324: mq: Make accessors of &overly-full-queue-warnings predictably named., gnunet, 2021/09/21
- [gnunet-scheme] 141/324: mq: Return the envelope after enqueueing and add more tests., gnunet, 2021/09/21
- [gnunet-scheme] 147/324: Merge branch 'master' into proper-mq, gnunet, 2021/09/21
- [gnunet-scheme] 97/324: utils: bv-slice: Define a record printer., gnunet, 2021/09/21
- [gnunet-scheme] 118/324: netstruct: Fix field lookup and offset calculation., gnunet, 2021/09/21
- [gnunet-scheme] 140/324: mq: Export &overly-full-queue-warning and friends., gnunet, 2021/09/21
- [gnunet-scheme] 144/324: mq: Test message cancellation., gnunet, 2021/09/21
- [gnunet-scheme] 145/324: mq: envelope: Correct spelling in comments and docstrings., gnunet, 2021/09/21
- [gnunet-scheme] 87/324: mq: define message queue module, gnunet, 2021/09/21
- [gnunet-scheme] 96/324: doc: Fix typo in README.org., gnunet, 2021/09/21