gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: -try to fix wirewatch loop


From: gnunet
Subject: [taler-exchange] branch master updated: -try to fix wirewatch loop
Date: Mon, 19 Dec 2022 15:53:18 +0100

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 8f33fe53 -try to fix wirewatch loop
8f33fe53 is described below

commit 8f33fe5311f521a67a6c78bfcc60997d4cb08cd2
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Dec 19 15:53:14 2022 +0100

    -try to fix wirewatch loop
---
 src/exchange/taler-exchange-wirewatch.c | 58 ++++++++++++++++++++-------------
 1 file changed, 35 insertions(+), 23 deletions(-)

diff --git a/src/exchange/taler-exchange-wirewatch.c 
b/src/exchange/taler-exchange-wirewatch.c
index 5ae56dd5..50e0dfbe 100644
--- a/src/exchange/taler-exchange-wirewatch.c
+++ b/src/exchange/taler-exchange-wirewatch.c
@@ -377,6 +377,8 @@ handle_soft_error (void)
   }
   /* Reset to beginning of transaction, and go again
      from there. */
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              "Encountered soft error, resetting start point to batch 
start\n");
   latest_row_off = batch_start;
   GNUNET_assert (NULL == task);
   task = GNUNET_SCHEDULER_add_now (&continue_with_shard,
@@ -595,6 +597,7 @@ process_reply (const struct TALER_BANK_CreditDetails 
*details,
       break;
     case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
       /* normal case */
+      progress = true;
       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                   "Completed shard %s (%llu,%llu] after %s\n",
                   job_name,
@@ -606,31 +609,40 @@ process_reply (const struct TALER_BANK_CreditDetails 
*details,
       break;
     }
   }
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Committing %s progress (%llu,%llu] at %llu\n (%s)",
-              job_name,
-              (unsigned long long) shard_start,
-              (unsigned long long) shard_end,
-              (unsigned long long) latest_row_off,
-              shard_done
+  if (! progress)
+  {
+    db_plugin->rollback (db_plugin->cls);
+  }
+  else
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                "Committing %s progress (%llu,%llu] at %llu\n (%s)",
+                job_name,
+                (unsigned long long) shard_start,
+                (unsigned long long) shard_end,
+                (unsigned long long) latest_row_off,
+                shard_done
               ? "shard done"
               : "shard incomplete");
-  qs = db_plugin->commit (db_plugin->cls);
-  switch (qs)
-  {
-  case GNUNET_DB_STATUS_HARD_ERROR:
-    GNUNET_break (0);
-    GNUNET_SCHEDULER_shutdown ();
-    return;
-  case GNUNET_DB_STATUS_SOFT_ERROR:
-    /* reduce transaction size to reduce rollback probability */
-    handle_soft_error ();
-    return;
-  case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
-  case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
-    started_transaction = false;
-    /* normal case */
-    break;
+    qs = db_plugin->commit (db_plugin->cls);
+    switch (qs)
+    {
+    case GNUNET_DB_STATUS_HARD_ERROR:
+      GNUNET_break (0);
+      GNUNET_SCHEDULER_shutdown ();
+      return;
+    case GNUNET_DB_STATUS_SOFT_ERROR:
+      /* reduce transaction size to reduce rollback probability */
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                  "Got DB soft error on commit. Reducing transaction size.\n");
+      handle_soft_error ();
+      return;
+    case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
+    case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
+      started_transaction = false;
+      /* normal case */
+      break;
+    }
   }
   if (shard_done)
   {

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