[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.
- [gnunet-scheme] branch master updated (5b37f53 -> dbb4430), gnunet, 2022/07/26
- [gnunet-scheme] 03/16: cadet/client: Remove duplicate stub definition of channel?., gnunet, 2022/07/26
- [gnunet-scheme] 06/16: tests/cadet: Run all the standard tests., gnunet, 2022/07/26
- [gnunet-scheme] 02/16: Revert "Eliminate guix.scm.", gnunet, 2022/07/26
- [gnunet-scheme] 05/16: network-size: Standardise test order., gnunet, 2022/07/26
- [gnunet-scheme] 10/16: nse/client: When the object is lost, stop the fibers.,
gnunet <=
- [gnunet-scheme] 01/16: .gitignore: Ignore more., gnunet, 2022/07/26
- [gnunet-scheme] 12/16: tests/cadet: Enable "garbage collectable" test., gnunet, 2022/07/26
- [gnunet-scheme] 08/16: nse/client: Make the <server> a <losable>., gnunet, 2022/07/26
- [gnunet-scheme] 07/16: tests/network-size: Test garbage collection of NSE server objects., gnunet, 2022/07/26
- [gnunet-scheme] 09/16: tests/network-size: Correct connect -> nse:connect., gnunet, 2022/07/26
- [gnunet-scheme] 11/16: doc/network-size-estimation: Document that disconnection happens automatically., gnunet, 2022/07/26
- [gnunet-scheme] 16/16: dht/client: Move some code into (gnu gnunet server)., gnunet, 2022/07/26
- [gnunet-scheme] 14/16: cadet/client: Handle 'reconnect!!'., gnunet, 2022/07/26
- [gnunet-scheme] 13/16: cadet/client: Handle 'resend-old-operations!'., gnunet, 2022/07/26
- [gnunet-scheme] 15/16: determine-reported-errors: Extract from the DHT tests., gnunet, 2022/07/26