gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet-scheme] 10/16: nse/client: When the object is lost, stop the fib


From: gnunet
Subject: [gnunet-scheme] 10/16: nse/client: When the object is lost, stop the fibers.
Date: Wed, 27 Jul 2022 00:21:20 +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 8b05e6959a29dd4fe5ecffdac8cb74f6e4a351b6
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sun Jul 24 00:56:52 2022 +0200

    nse/client: When the object is lost, stop the fibers.
    
    * gnu/gnunet/nse/client.scm
    (reconnects): Add argument 'lost-and-found'.
    [request-close-handler]: Wait on it, among other things.
    (connect): Set 'lost-and-found'.
    * tests/network-size.scm ("garbage collectable"): Don't expect the now
    passing test to fail.
---
 gnu/gnunet/nse/client.scm | 12 ++++++++++--
 tests/network-size.scm    |  1 -
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/gnu/gnunet/nse/client.scm b/gnu/gnunet/nse/client.scm
index d4317d0..e4986f1 100644
--- a/gnu/gnunet/nse/client.scm
+++ b/gnu/gnunet/nse/client.scm
@@ -54,7 +54,9 @@
          (only (guile)
                define* const)
          (only (gnu gnunet concurrency lost-and-found)
-               make-lost-and-found <losable>)
+               make-lost-and-found <losable>
+               losable-lost-and-found
+               collect-lost-and-found-operation)
          (only (gnu gnunet util struct)
                /:message-header)
          (only (gnu gnunet utils bv-slice)
@@ -136,6 +138,7 @@ even if not connected.  This is an idempotent operation."
 
     ;; See 'connect'.
     (define* (reconnect estimate/box request-close?/box 
request-close-condition config
+                       lost-and-found
                        #:key
                        updated connected disconnected spawn #:rest rest)
       (define (handle-estimate! estimate-slice)
@@ -198,7 +201,7 @@ even if not connected.  This is an idempotent operation."
           ;; created.
           (unless (atomic-box-ref request-close?/box)
             (apply reconnect estimate/box request-close?/box 
request-close-condition
-                   config rest)))
+                   config lost-and-found rest)))
          ((connection:interrupted)
           (values))
          (else
@@ -211,6 +214,10 @@ even if not connected.  This is an idempotent operation."
       (define (request-close-handler)
        (perform-operation
         (choice-operation
+         ;; We lost ourselves, that means the server became unreachable.
+         ;; The presence of this line is tested by the "garbage collectable"
+         ;; test.
+         (collect-lost-and-found-operation lost-and-found)
          (wait-operation request-close-condition)
          ;; Make sure the fiber exits after a reconnect.
          (wait-operation mq-closed)))
@@ -239,6 +246,7 @@ The procedures @var{updated}, @var{connected} and 
@var{disconnected} are optiona
                 (server-request-close?/box server)
                 (server-request-close-condition server)
                 config
+                (losable-lost-and-found server)
                 #:updated updated #:connected connected #:disconnected 
disconnected
                 #:spawn spawn)
       server)))
diff --git a/tests/network-size.scm b/tests/network-size.scm
index 1873795..7e3e352 100644
--- a/tests/network-size.scm
+++ b/tests/network-size.scm
@@ -51,7 +51,6 @@
    "nse" nse:connect nse:disconnect!
    #:rest (list #:disconnected #{don't-call-me}#)))
 
-(test-expect-fail 1) ; TODO
 (test-assert "garbage collectable"
   (garbage-collectable "nse" nse:connect))
 

-- 
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]