diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-03-18 09:12:55 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-03-18 09:12:55 -0400 |
commit | 7df9e40cc0a85aeb61e4de1a4c584fbe7e13824f (patch) | |
tree | 5f9ef313955fbd4a03db5817049386efa44d4232 /src/c | |
parent | 7648fd91779c25ec3d9eef336b41023d255e1a3e (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.c | 3 |
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) |