summaryrefslogtreecommitdiff
path: root/src/c
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-03-18 09:12:55 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-03-18 09:12:55 -0400
commit7df9e40cc0a85aeb61e4de1a4c584fbe7e13824f (patch)
tree5f9ef313955fbd4a03db5817049386efa44d4232 /src/c
parent7648fd91779c25ec3d9eef336b41023d255e1a3e (diff)
Exit periodic loop if a ROLLBACK fails, to avoid infinite looping when the database server is brought down
Diffstat (limited to 'src/c')
-rw-r--r--src/c/request.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/c/request.c b/src/c/request.c
index a5f0e2f1..2d0d0dc7 100644
--- a/src/c/request.c
+++ b/src/c/request.c
@@ -111,7 +111,8 @@ static void *periodic_loop(void *data) {
else if (r == FATAL)
p->ls->log_error(p->ls->logger_data, "Fatal error: %s\n", uw_error_message(ctx));
if (r == FATAL || r == BOUNDED_RETRY || r == UNLIMITED_RETRY)
- try_rollback(ctx, 0, p->ls->logger_data, p->ls->log_error);
+ if (try_rollback(ctx, 0, p->ls->logger_data, p->ls->log_error))
+ return NULL;
} while (r == UNLIMITED_RETRY || (r == BOUNDED_RETRY && retries_left > 0));
if (r != FATAL && r != BOUNDED_RETRY)