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 | 067ef4945e6813a5456f74da2091f068c46bfb57 (patch) | |
tree | 5f9ef313955fbd4a03db5817049386efa44d4232 /src | |
parent | 538cedd06c3779e564ed123d4747c8278b431e46 (diff) |
Exit periodic loop if a ROLLBACK fails, to avoid infinite looping when the database server is brought down
Diffstat (limited to 'src')
-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) |