diff --git a/contrib/gana b/contrib/gana index 02132eded..1ec4596bf 160000 --- a/contrib/gana +++ b/contrib/gana @@ -1 +1 @@ -Subproject commit 02132ededc12a0a1cfd81f0ca76c384304e15259 +Subproject commit 1ec4596bf4925ee24fc06d3e74d2a553b8239870 diff --git a/debian/taler-exchange.taler-exchange-httpd.service b/debian/taler-exchange.taler-exchange-httpd.service index 98d76f6fb..3671bdc7d 100644 --- a/debian/taler-exchange.taler-exchange-httpd.service +++ b/debian/taler-exchange.taler-exchange-httpd.service @@ -8,11 +8,19 @@ PartOf=taler-exchange.target [Service] User=taler-exchange-httpd Type=simple -# Depending on the configuration, the service suicides and then -# needs to be restarted. + +# Depending on the configuration, the service process kills itself and then +# needs to be restarted. Thus no significant delay on restarts. Restart=always -# Do not dally on restarts. RestartSec=1ms + +# Disable the service if more than 5 restarts are encountered within 5s. +# These are usually the systemd defaults, but can be overwritten, thus we set +# them here explicitly, as the exchange code assumes StartLimitInterval +# to be >=5s. +StartLimitBurst=5 +StartLimitInterval=5s + ExecStart=/usr/bin/taler-exchange-httpd -c /etc/taler/taler.conf StandardOutput=journal StandardError=journal diff --git a/src/bank-lib/bank_api_credit.c b/src/bank-lib/bank_api_credit.c index 9835a8c9d..4842de969 100644 --- a/src/bank-lib/bank_api_credit.c +++ b/src/bank-lib/bank_api_credit.c @@ -248,12 +248,15 @@ TALER_BANK_credit_history (struct GNUNET_CURL_Context *ctx, { if ( (0 < num_results) && (! GNUNET_TIME_relative_is_zero (timeout)) ) + /* 0 == start_row is implied, go with timeout into future */ GNUNET_snprintf (url, sizeof (url), "history/incoming?delta=%lld&long_poll_ms=%llu", (long long) num_results, tms); else + /* Going back from current transaction or have no timeout; + hence timeout makes no sense */ GNUNET_snprintf (url, sizeof (url), "history/incoming?delta=%lld", @@ -263,6 +266,7 @@ TALER_BANK_credit_history (struct GNUNET_CURL_Context *ctx, { if ( (0 < num_results) && (! GNUNET_TIME_relative_is_zero (timeout)) ) + /* going forward from num_result */ GNUNET_snprintf (url, sizeof (url), "history/incoming?delta=%lld&start=%llu&long_poll_ms=%llu", @@ -270,6 +274,8 @@ TALER_BANK_credit_history (struct GNUNET_CURL_Context *ctx, (unsigned long long) start_row, tms); else + /* going backwards or have no timeout; + hence timeout makes no sense */ GNUNET_snprintf (url, sizeof (url), "history/incoming?delta=%lld&start=%llu", diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c index c88ddd7c8..d247d981b 100644 --- a/src/exchange/taler-exchange-httpd.c +++ b/src/exchange/taler-exchange-httpd.c @@ -80,6 +80,11 @@ */ #define UNIX_BACKLOG 50 +/** + * How often will we try to connect to the database before giving up? + */ +#define MAX_DB_RETRIES 5 + /** * Above what request latency do we start to log? */ @@ -1965,11 +1970,20 @@ exchange_serve_process_config (void) GNUNET_free (attr_enc_key_str); } - if (NULL == - (TEH_plugin = TALER_EXCHANGEDB_plugin_load (TEH_cfg))) + for (unsigned int i = 0; iconnection, - csr_obj, - MHD_HTTP_OK); - } + return TALER_MHD_REPLY_JSON_PACK ( + rc->connection, + MHD_HTTP_OK, + TALER_JSON_pack_exchange_withdraw_values ("ewv", + &ewv)); } diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c index 8b72d7803..d73283509 100644 --- a/src/exchange/taler-exchange-httpd_keys.c +++ b/src/exchange/taler-exchange-httpd_keys.c @@ -738,7 +738,7 @@ free_denom_cb (void *cls, * @param value the `struct HelperSignkey` to release * @return #GNUNET_OK (continue to iterate) */ -static int +static enum GNUNET_GenericReturnValue free_esign_cb (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) @@ -3616,6 +3616,7 @@ TEH_keys_management_get_keys_handler (const struct TEH_RequestHandler *rh, if ( (GNUNET_is_zero (&denom_rsa_sm_pub)) && (GNUNET_is_zero (&denom_cs_sm_pub)) ) { + /* Either IPC failed, or neither helper had any denominations configured. */ return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_GATEWAY, TALER_EC_EXCHANGE_DENOMINATION_HELPER_UNAVAILABLE, @@ -3628,7 +3629,6 @@ TEH_keys_management_get_keys_handler (const struct TEH_RequestHandler *rh, TALER_EC_EXCHANGE_SIGNKEY_HELPER_UNAVAILABLE, NULL); } - // then a secmod helper is not yet running and we should return an MHD_HTTP_BAD_GATEWAY! GNUNET_assert (NULL != fbc.denoms); GNUNET_assert (NULL != fbc.signkeys); GNUNET_CONTAINER_multihashmap_iterate (ksh->helpers->denom_keys, diff --git a/src/exchange/taler-exchange-wirewatch.c b/src/exchange/taler-exchange-wirewatch.c index a7a6b004f..168e7b9b7 100644 --- a/src/exchange/taler-exchange-wirewatch.c +++ b/src/exchange/taler-exchange-wirewatch.c @@ -757,7 +757,7 @@ continue_with_shard (void *cls) shard_end - latest_row_off); GNUNET_assert (NULL == hh); GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Requesting credit history staring from %llu\n", + "Requesting credit history starting from %llu\n", (unsigned long long) latest_row_off); hh_start_time = GNUNET_TIME_absolute_get (); hh_returned_data = false; diff --git a/src/lib/exchange_api_reserves_get.c b/src/lib/exchange_api_reserves_get.c index d829b4593..1c2c2b027 100644 --- a/src/lib/exchange_api_reserves_get.c +++ b/src/lib/exchange_api_reserves_get.c @@ -168,9 +168,10 @@ handle_reserves_get_finished (void *cls, rs.hr.ec = TALER_JSON_get_error_code (j); rs.hr.hint = TALER_JSON_get_error_hint (j); GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Unexpected response code %u/%d for reserves get\n", + "Unexpected response code %u/%d for GET %s\n", (unsigned int) response_code, - (int) rs.hr.ec); + (int) rs.hr.ec, + rgh->url); break; } if (NULL != rgh->cb)