[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] 01/02: more aggressive rollback on failures
From: |
gnunet |
Subject: |
[taler-exchange] 01/02: more aggressive rollback on failures |
Date: |
Wed, 08 Dec 2021 16:11:56 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
commit b64f718037aa318e83424fa6e2e83021908ff1dc
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Dec 8 16:11:27 2021 +0100
more aggressive rollback on failures
---
src/exchange/taler-exchange-httpd_db.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/src/exchange/taler-exchange-httpd_db.c
b/src/exchange/taler-exchange-httpd_db.c
index da495517..c091f994 100644
--- a/src/exchange/taler-exchange-httpd_db.c
+++ b/src/exchange/taler-exchange-httpd_db.c
@@ -163,15 +163,20 @@ TEH_DB_run_transaction (struct MHD_Connection *connection,
if (GNUNET_DB_STATUS_HARD_ERROR == qs)
return GNUNET_SYSERR;
if (0 <= qs)
- qs = TEH_plugin->commit (TEH_plugin->cls);
- if (GNUNET_DB_STATUS_HARD_ERROR == qs)
{
- if (NULL != mhd_ret)
- *mhd_ret = TALER_MHD_reply_with_error (connection,
- MHD_HTTP_INTERNAL_SERVER_ERROR,
-
TALER_EC_GENERIC_DB_COMMIT_FAILED,
- NULL);
- return GNUNET_SYSERR;
+ qs = TEH_plugin->commit (TEH_plugin->cls);
+ if (GNUNET_DB_STATUS_HARD_ERROR == qs)
+ {
+ TEH_plugin->rollback (TEH_plugin->cls);
+ if (NULL != mhd_ret)
+ *mhd_ret = TALER_MHD_reply_with_error (connection,
+
MHD_HTTP_INTERNAL_SERVER_ERROR,
+
TALER_EC_GENERIC_DB_COMMIT_FAILED,
+ NULL);
+ return GNUNET_SYSERR;
+ }
+ if (0 > qs)
+ TEH_plugin->rollback (TEH_plugin->cls);
}
/* make sure callback did not violate invariants! */
GNUNET_assert ( (NULL == mhd_ret) ||
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.