gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: fix for soft fail error handling


From: gnunet
Subject: [taler-exchange] branch master updated: fix for soft fail error handling in wirewatch discovered in #6892, bugnote 17930: bank API calls us one more time after returning SYSERR, and we must in that case not bump the progress point just because a commit succeeds after the rollback
Date: Sat, 29 May 2021 08:40:04 +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 060816ea fix for soft fail error handling in wirewatch discovered in 
#6892, bugnote 17930: bank API calls us one more time after returning SYSERR, 
and we must in that case not bump the progress point just because a commit 
succeeds after the rollback
060816ea is described below

commit 060816eafd6756575e94982e224ac47c8c6e69a6
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Sat May 29 08:38:33 2021 +0200

    fix for soft fail error handling in wirewatch discovered in #6892, bugnote 
17930: bank API calls us one more time after returning SYSERR, and we must in 
that case not bump the progress point just because a commit succeeds after the 
rollback
---
 src/exchange/taler-exchange-wirewatch.c | 28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git a/src/exchange/taler-exchange-wirewatch.c 
b/src/exchange/taler-exchange-wirewatch.c
index 1b5c5d41..480b3ee3 100644
--- a/src/exchange/taler-exchange-wirewatch.c
+++ b/src/exchange/taler-exchange-wirewatch.c
@@ -111,6 +111,11 @@ struct WireAccount
    */
   int delay;
 
+  /**
+   * Did we experience a soft failure during the current
+   * transaction?
+   */
+  bool soft_fail;
 };
 
 
@@ -358,10 +363,20 @@ history_cb (void *cls,
                   (unsigned int) ec,
                   http_status);
     }
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "End of list. Committing progress!\n");
-    qs = db_plugin->commit (db_plugin->cls,
-                            session);
+    if (wa->soft_fail)
+    {
+      /* no point to commit, transaction was already rolled
+         back after we encountered a soft failure */
+      wa->soft_fail = false;
+      qs = GNUNET_DB_STATUS_SOFT_ERROR;
+    }
+    else
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                  "End of list. Committing progress!\n");
+      qs = db_plugin->commit (db_plugin->cls,
+                              session);
+    }
     if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -459,10 +474,7 @@ history_cb (void *cls,
                 "Got DB soft error for reserves_in_insert. Rolling back.\n");
     db_plugin->rollback (db_plugin->cls,
                          session);
-    /* try again */
-    GNUNET_assert (NULL == task);
-    task = GNUNET_SCHEDULER_add_now (&find_transfers,
-                                     NULL);
+    wa->soft_fail = true;
     return GNUNET_SYSERR;
   }
   wa->delay = GNUNET_NO;

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