gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: die on bugs, do not commit


From: gnunet
Subject: [taler-merchant] branch master updated: die on bugs, do not commit
Date: Tue, 20 Jul 2021 17:46:46 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 43dd7c8a die on bugs, do not commit
43dd7c8a is described below

commit 43dd7c8ae663fcb3db64fb7571c56144baa83a0e
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Jul 20 17:46:42 2021 +0200

    die on bugs, do not commit
---
 .../taler-merchant-httpd_private-post-instances.c  |  1 +
 src/backenddb/merchant-0002.sql                    |  2 +-
 src/backenddb/plugin_merchantdb_postgres.c         | 25 +++++-----------------
 src/include/taler_merchantdb_plugin.h              |  6 +++---
 4 files changed, 10 insertions(+), 24 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_private-post-instances.c 
b/src/backend/taler-merchant-httpd_private-post-instances.c
index 95f2ca37..f9df3d39 100644
--- a/src/backend/taler-merchant-httpd_private-post-instances.c
+++ b/src/backend/taler-merchant-httpd_private-post-instances.c
@@ -310,6 +310,7 @@ TMH_private_post_instances (const struct TMH_RequestHandler 
*rh,
                                          "id");
   }
 
+  /* Check currency of client matches our own currency */
   if ( (0 != strcasecmp (is.default_max_deposit_fee.currency,
                          TMH_currency)) ||
        (0 != strcasecmp (is.default_max_wire_fee.currency,
diff --git a/src/backenddb/merchant-0002.sql b/src/backenddb/merchant-0002.sql
index 46428dd9..1cb1d7b2 100644
--- a/src/backenddb/merchant-0002.sql
+++ b/src/backenddb/merchant-0002.sql
@@ -18,7 +18,7 @@
 BEGIN;
 
 -- Check patch versioning is in place.
-SELECT _v.register_patch('merchant-0002', NULL, NULL);
+SELECT _v.register_patch('merchant-0002', ARRAY['merchant-0001'], NULL);
 
 
 -- need serial IDs on various tables for exchange-auditor replication
diff --git a/src/backenddb/plugin_merchantdb_postgres.c 
b/src/backenddb/plugin_merchantdb_postgres.c
index 2dc17b43..ed051053 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -155,7 +155,7 @@ postgres_create_tables (void *cls)
 
 /**
  * Do a pre-flight check that we are not in an uncommitted transaction.
- * If we are, try to commit the previous transaction and output a warning.
+ * If we are, die.
  * Does not return anything, as we will continue regardless of the outcome.
  *
  * @param cls the `struct PostgresClosure` with the plugin-specific state
@@ -164,28 +164,13 @@ static void
 postgres_preflight (void *cls)
 {
   struct PostgresClosure *pg = cls;
-  struct GNUNET_PQ_ExecuteStatement es[] = {
-    GNUNET_PQ_make_execute ("COMMIT"),
-    GNUNET_PQ_EXECUTE_STATEMENT_END
-  };
 
   if (NULL == pg->transaction_name)
     return; /* all good */
-  if (GNUNET_OK ==
-      GNUNET_PQ_exec_statements (pg->conn,
-                                 es))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "BUG: Preflight check committed transaction `%s'!\n",
-                pg->transaction_name);
-  }
-  else
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "BUG: Preflight check failed to commit transaction `%s'!\n",
-                pg->transaction_name);
-  }
-  pg->transaction_name = NULL;
+  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+              "BUG: Preflight check detected running transaction `%s'!\n",
+              pg->transaction_name);
+  GNUNET_assert (0);
 }
 
 
diff --git a/src/include/taler_merchantdb_plugin.h 
b/src/include/taler_merchantdb_plugin.h
index beeee462..f3989790 100644
--- a/src/include/taler_merchantdb_plugin.h
+++ b/src/include/taler_merchantdb_plugin.h
@@ -717,9 +717,9 @@ struct TALER_MERCHANTDB_Plugin
   (*create_tables) (void *cls);
 
   /**
-   * Do a pre-flight check that we are not in an uncommitted transaction.
-   * If we are, try to commit the previous transaction and output a warning.
-   * Does not return anything, as we will continue regardless of the outcome.
+   * Do a pre-flight check that we are not in an uncommitted transaction.  If
+   * we are, die.  Does not return anything, as we will continue regardless of
+   * the outcome.
    *
    * @param cls the `struct PostgresClosure` with the plugin-specific state
    */

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