gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] branch master updated (db65bc6 -> 9887077)


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated (db65bc6 -> 9887077)
Date: Fri, 10 Aug 2018 18:48:48 +0200

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

grothoff pushed a change to branch master
in repository exchange.

    from db65bc6  fix bug wrt signature handling during withdraw (with/without 
optimistic signing)
     new e17121f  use retry in benchmark
     new 9887077  launch wirewatch in the background for benchmarking

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/benchmark/taler-exchange-benchmark.c    | 104 +++++++++++++++++++---------
 src/exchange-lib/testing_api_cmd_withdraw.c |   4 ++
 2 files changed, 74 insertions(+), 34 deletions(-)

diff --git a/src/benchmark/taler-exchange-benchmark.c 
b/src/benchmark/taler-exchange-benchmark.c
index 7e6fd20..3440b3b 100644
--- a/src/benchmark/taler-exchange-benchmark.c
+++ b/src/benchmark/taler-exchange-benchmark.c
@@ -351,10 +351,6 @@ run (void *cls,
     CMD_TRANSFER_TO_EXCHANGE
       ("create-reserve",
        TALER_amount_to_string (&total_reserve_amount)),
-    /* FIXME: remove wirewatch here! */
-    TALER_TESTING_cmd_exec_wirewatch
-      ("wirewatch",
-       cfg_filename),
     TALER_TESTING_cmd_end ()
   };
 
@@ -372,12 +368,14 @@ run (void *cls,
     GNUNET_asprintf (&order_enc,
                      "{\"nonce\": %u}",
                      i);
-    unit[0] = TALER_TESTING_cmd_withdraw_amount
-      (withdraw_label,
-       is->exchange,
-       "create-reserve",
-       AMOUNT_5,
-       MHD_HTTP_OK);
+    unit[0] =
+      TALER_TESTING_cmd_withdraw_with_retry
+      (TALER_TESTING_cmd_withdraw_amount
+       (withdraw_label,
+       is->exchange,
+       "create-reserve",
+       AMOUNT_5,
+       MHD_HTTP_OK));
     unit[1] = TALER_TESTING_cmd_deposit
       ("deposit",
        is->exchange,
@@ -504,6 +502,22 @@ parallel_benchmark (TALER_TESTING_Main main_cb,
   pid_t fakebank;
   int wstatus;
   struct GNUNET_OS_Process *exchanged;
+  struct GNUNET_OS_Process *wirewatch;
+
+  /* start fakebank */
+  fakebank = fork ();
+  if (0 == fakebank)
+  {
+    GNUNET_SCHEDULER_run (&launch_fakebank,
+                          exchange_bank_account.bank_base_url);
+    exit (0);
+  }
+  if (-1 == fakebank)
+  {
+    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR,
+                         "fork");
+    return GNUNET_SYSERR;
+  }
 
   /* start exchange */
   exchanged = GNUNET_OS_start_process (GNUNET_NO,
@@ -515,34 +529,50 @@ parallel_benchmark (TALER_TESTING_Main main_cb,
                                        "-i",
                                        NULL);
   if (NULL == exchanged)
-    return GNUNET_SYSERR;
-  if (0 != TALER_TESTING_wait_exchange_ready (exchange_url))
+  {
+    kill (fakebank,
+         SIGTERM);
+    waitpid (fakebank,
+            &wstatus,
+            0);
+    return 77;
+  }
+  /* start exchange */
+  wirewatch = GNUNET_OS_start_process (GNUNET_NO,
+                                       GNUNET_OS_INHERIT_STD_ALL,
+                                       NULL, NULL, NULL,
+                                       "taler-exchange-wirewatch",
+                                       "taler-exchange-wirewatch",
+                                       "-c", config_file,
+                                       NULL);
+  if (NULL == wirewatch)
   {
     GNUNET_OS_process_kill (exchanged,
                             SIGTERM);
+    kill (fakebank,
+         SIGTERM);
     GNUNET_OS_process_wait (exchanged);
     GNUNET_OS_process_destroy (exchanged);
+    waitpid (fakebank,
+            &wstatus,
+            0);
     return 77;
   }
-  /* start fakebank */
-  fakebank = fork ();
-  if (0 == fakebank)
-  {
-    GNUNET_SCHEDULER_run (&launch_fakebank,
-                          exchange_bank_account.bank_base_url);
-    exit (0);
-  }
-  if (-1 == fakebank)
+  if (0 != TALER_TESTING_wait_exchange_ready (exchange_url))
   {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR,
-                         "fork");
-    result = GNUNET_SYSERR;
+    GNUNET_OS_process_kill (exchanged,
+                            SIGTERM);
+    kill (fakebank,
+         SIGTERM);
+    GNUNET_OS_process_wait (exchanged);
+    GNUNET_OS_process_destroy (exchanged);
+    waitpid (fakebank,
+            &wstatus,
+            0);
     return 77;
   }
   sleep (1); /* make sure fakebank process is ready before continuing */
 
-  /* FIXME: start wirewatch */
-
   start_time = GNUNET_TIME_absolute_get ();
   result = GNUNET_OK;
   for (unsigned int i=0;i<howmany_clients;i++)
@@ -583,8 +613,21 @@ parallel_benchmark (TALER_TESTING_Main main_cb,
       result = GNUNET_SYSERR;
     }
   }
-  /* FIXME: stop wirewatch */
 
+  /* stop wirewatch */
+  GNUNET_break (0 ==
+                GNUNET_OS_process_kill (wirewatch,
+                                        SIGTERM));
+  GNUNET_break (GNUNET_OK ==
+                GNUNET_OS_process_wait (wirewatch));
+  GNUNET_OS_process_destroy (wirewatch);
+  /* stop exchange */
+  GNUNET_break (0 ==
+                GNUNET_OS_process_kill (exchanged,
+                                        SIGTERM));
+  GNUNET_break (GNUNET_OK ==
+                GNUNET_OS_process_wait (exchanged));
+  GNUNET_OS_process_destroy (exchanged);
   /* stop fakebank */
   if (0 != kill (fakebank,
                  SIGTERM))
@@ -599,13 +642,6 @@ parallel_benchmark (TALER_TESTING_Main main_cb,
     GNUNET_break (0);
     result = GNUNET_SYSERR;
   }
-  /* stop exchange */
-  GNUNET_break (0 ==
-                GNUNET_OS_process_kill (exchanged,
-                                        SIGTERM));
-  GNUNET_break (GNUNET_OK ==
-                GNUNET_OS_process_wait (exchanged));
-  GNUNET_OS_process_destroy (exchanged);
   return result;
 }
 
diff --git a/src/exchange-lib/testing_api_cmd_withdraw.c 
b/src/exchange-lib/testing_api_cmd_withdraw.c
index c707549..50cc45e 100644
--- a/src/exchange-lib/testing_api_cmd_withdraw.c
+++ b/src/exchange-lib/testing_api_cmd_withdraw.c
@@ -169,6 +169,10 @@ reserve_withdraw_cb (void *cls,
   {
     if (GNUNET_YES == ws->do_retry)
     {
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                 "Retrying withdraw failed with %u/%d\n",
+                 http_status,
+                 (int) ec);
       if ( (TALER_EC_DB_COMMIT_FAILED_ON_RETRY == ec) ||
           (TALER_EC_WITHDRAW_INSUFFICIENT_FUNDS == ec) ||
           (TALER_EC_WITHDRAW_RESERVE_UNKNOWN == ec) ||

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]