exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 4a6cfde8d1b9a1eb4f8cc253b92d531d23855778
parent 880e9be1d69fdf4cc8a10998d4181bebe15a5f8b
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Sat, 11 Jul 2026 20:21:05 +0200

propagate SOFT error up to enable retry

Diffstat:
Msrc/exchange/taler-exchange-httpd_get-transfers-WTID.c | 14+++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/exchange/taler-exchange-httpd_get-transfers-WTID.c b/src/exchange/taler-exchange-httpd_get-transfers-WTID.c @@ -262,6 +262,13 @@ struct WtidTransactionContext */ enum GNUNET_GenericReturnValue is_valid; + /** + * Database status of a failed query inside the deposit + * iterator, used to distinguish a (retryable) serialization + * failure from a hard error when @e is_valid is #GNUNET_SYSERR. + */ + enum GNUNET_DB_QueryStatus qs; + }; @@ -339,7 +346,8 @@ handle_deposit_data ( &total_refunds); if (qs < 0) { - GNUNET_break (0); + GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs); + ctx->qs = qs; ctx->is_valid = GNUNET_SYSERR; return; } @@ -509,6 +517,8 @@ get_transfer_deposits (void *cls, /* resetting to NULL/0 in case transaction was repeated after serialization failure */ free_ctx (ctx); + ctx->is_valid = GNUNET_NO; + ctx->qs = GNUNET_DB_STATUS_SUCCESS_NO_RESULTS; qs = TALER_EXCHANGEDB_lookup_wire_transfer (TEH_pg, &ctx->wtid, &handle_deposit_data, @@ -528,6 +538,8 @@ get_transfer_deposits (void *cls, } if (GNUNET_SYSERR == ctx->is_valid) { + if (GNUNET_DB_STATUS_SOFT_ERROR == ctx->qs) + return GNUNET_DB_STATUS_SOFT_ERROR; /* serialization issue, retry */ GNUNET_break (0); *mhd_ret = TALER_MHD_reply_with_error ( connection,