[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] 01/02: use different sleep when idle vs. when conflicti
From: |
gnunet |
Subject: |
[taler-exchange] 01/02: use different sleep when idle vs. when conflicting in wirewatch |
Date: |
Fri, 06 Jan 2023 13:35:05 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
commit 7ee7790ac46152d8da1238b20c861b694381c748
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Jan 6 13:34:01 2023 +0100
use different sleep when idle vs. when conflicting in wirewatch
---
src/exchange/taler-exchange-wirewatch.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/exchange/taler-exchange-wirewatch.c
b/src/exchange/taler-exchange-wirewatch.c
index f22c341b..4e26bad7 100644
--- a/src/exchange/taler-exchange-wirewatch.c
+++ b/src/exchange/taler-exchange-wirewatch.c
@@ -153,6 +153,11 @@ static struct TALER_EXCHANGEDB_Plugin *db_plugin;
*/
static struct GNUNET_TIME_Relative wirewatch_idle_sleep_interval;
+/**
+ * How long do we sleep on serialization conflicts?
+ */
+static struct GNUNET_TIME_Relative wirewatch_conflict_sleep_interval;
+
/**
* Modulus to apply to group shards. The shard size must ultimately be a
* multiple of the batch size. Thus, if this is not a multiple of the
@@ -1066,10 +1071,10 @@ history_cb (void *cls,
process_reply (reply->details.success.details,
reply->details.success.details_length);
break;
- /* case 0:
- process_reply_batched (reply->details.success.details,
- reply->details.success.details_length);
- break;*/
+ /* case 0:
+ process_reply_batched (reply->details.success.details,
+ reply->details.success.details_length);
+ break;*/
default:
process_reply_batched2 ((unsigned int) batch_mode,
reply->details.success.details,
@@ -1200,7 +1205,9 @@ lock_shard (void *cls)
{
struct GNUNET_TIME_Relative rdelay;
- rdelay = GNUNET_TIME_randomize (wirewatch_idle_sleep_interval);
+ wirewatch_conflict_sleep_interval
+ = GNUNET_TIME_STD_BACKOFF (wirewatch_conflict_sleep_interval);
+ rdelay = GNUNET_TIME_randomize (wirewatch_conflict_sleep_interval);
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Serialization error tying to obtain shard %s, will try
again in %s!\n",
job_name,
@@ -1227,6 +1234,7 @@ lock_shard (void *cls)
return;
case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
/* continued below */
+ wirewatch_conflict_sleep_interval = GNUNET_TIME_UNIT_ZERO;
break;
}
shard_end_time = GNUNET_TIME_relative_to_absolute (delay);
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.