aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-01-06 13:34:01 +0100
committerChristian Grothoff <christian@grothoff.org>2023-01-06 13:34:01 +0100
commit7ee7790ac46152d8da1238b20c861b694381c748 (patch)
tree0d9f2d07661704cde62ce346cc5a19055949aebe /src
parent463b3af4ea2523d87205daa7c53d91be47542057 (diff)
use different sleep when idle vs. when conflicting in wirewatch
Diffstat (limited to 'src')
-rw-r--r--src/exchange/taler-exchange-wirewatch.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/exchange/taler-exchange-wirewatch.c b/src/exchange/taler-exchange-wirewatch.c
index f22c341b8..4e26bad7d 100644
--- a/src/exchange/taler-exchange-wirewatch.c
+++ b/src/exchange/taler-exchange-wirewatch.c
@@ -154,6 +154,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
* #MAXIMUM_BATCH_SIZE, the batch size will be set to the #shard_size.
@@ -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);