[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: -revise shard locking: resume op
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: -revise shard locking: resume open shards before starting new ones |
Date: |
Tue, 24 May 2022 09:52:26 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
The following commit(s) were added to refs/heads/master by this push:
new daddc69d -revise shard locking: resume open shards before starting new
ones
daddc69d is described below
commit daddc69dc9bfdcc521bb7cada925e77441d36f7d
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue May 24 09:52:23 2022 +0200
-revise shard locking: resume open shards before starting new ones
---
contrib/gana | 2 +-
src/exchange/taler-exchange-wirewatch.c | 23 +++++++++++++++++++++++
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/contrib/gana b/contrib/gana
index fa6373d8..99d8d9e0 160000
--- a/contrib/gana
+++ b/contrib/gana
@@ -1 +1 @@
-Subproject commit fa6373d8e2432cd63da881e05f4100240e688cdf
+Subproject commit 99d8d9e0336bacebab5af4ae00c3f685ffd90f60
diff --git a/src/exchange/taler-exchange-wirewatch.c
b/src/exchange/taler-exchange-wirewatch.c
index 7cc4ac38..a5efda72 100644
--- a/src/exchange/taler-exchange-wirewatch.c
+++ b/src/exchange/taler-exchange-wirewatch.c
@@ -106,6 +106,11 @@ struct WireAccount
*/
struct GNUNET_TIME_Absolute shard_start_time;
+ /**
+ * For how long did we lock the shard?
+ */
+ struct GNUNET_TIME_Absolute shard_end_time;
+
/**
* How long did we take to finish the last shard
* for this account?
@@ -138,6 +143,10 @@ struct WireAccount
*/
bool started_transaction;
+ /**
+ * Is this shard still open for processing.
+ */
+ bool shard_open;
};
@@ -537,6 +546,8 @@ do_commit (struct WireAccount *wa)
GNUNET_assert (NULL == task);
shard_done = check_shard_done (wa);
wa->started_transaction = false;
+ if (shard_done)
+ wa->shard_open = false;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Committing %s progress (%llu,%llu] at %llu\n (%s)",
wa->job_name,
@@ -795,6 +806,16 @@ lock_shard (void *cls)
GNUNET_SCHEDULER_shutdown ();
return;
}
+ if ( (wa->shard_open) &&
+ (GNUNET_TIME_absolute_is_future (wa->shard_end_time)) )
+ {
+ wa->delay = true; /* default is to delay, unless
+ we find out that we're really busy */
+ wa->batch_start = wa->latest_row_off;
+ task = GNUNET_SCHEDULER_add_now (&continue_with_shard,
+ wa);
+ return;
+ }
/* How long we lock a shard depends on the number of
workers expected, and how long we usually took to
process a shard. */
@@ -855,6 +876,8 @@ lock_shard (void *cls)
/* continued below */
break;
}
+ wa->shard_end_time = GNUNET_TIME_relative_to_absolute (delay);
+ wa->shard_open = true;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Starting with shard %s at (%llu,%llu] locked for %s\n",
wa->job_name,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-exchange] branch master updated: -revise shard locking: resume open shards before starting new ones,
gnunet <=