Mercurial > urweb
comparison src/c/request.c @ 1437:493e087f5479
Exit periodic loop if a ROLLBACK fails, to avoid infinite looping when the database server is brought down
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Fri, 18 Mar 2011 09:12:55 -0400 |
parents | 22674ac8ebe6 |
children | 36f7d1debb37 |
comparison
equal
deleted
inserted
replaced
1436:3d5e4c5fb6ee | 1437:493e087f5479 |
---|---|
109 else if (r == BOUNDED_RETRY) | 109 else if (r == BOUNDED_RETRY) |
110 p->ls->log_debug(p->ls->logger_data, "Error triggers bounded retry in periodic: %s\n", uw_error_message(ctx)); | 110 p->ls->log_debug(p->ls->logger_data, "Error triggers bounded retry in periodic: %s\n", uw_error_message(ctx)); |
111 else if (r == FATAL) | 111 else if (r == FATAL) |
112 p->ls->log_error(p->ls->logger_data, "Fatal error: %s\n", uw_error_message(ctx)); | 112 p->ls->log_error(p->ls->logger_data, "Fatal error: %s\n", uw_error_message(ctx)); |
113 if (r == FATAL || r == BOUNDED_RETRY || r == UNLIMITED_RETRY) | 113 if (r == FATAL || r == BOUNDED_RETRY || r == UNLIMITED_RETRY) |
114 try_rollback(ctx, 0, p->ls->logger_data, p->ls->log_error); | 114 if (try_rollback(ctx, 0, p->ls->logger_data, p->ls->log_error)) |
115 return NULL; | |
115 } while (r == UNLIMITED_RETRY || (r == BOUNDED_RETRY && retries_left > 0)); | 116 } while (r == UNLIMITED_RETRY || (r == BOUNDED_RETRY && retries_left > 0)); |
116 | 117 |
117 if (r != FATAL && r != BOUNDED_RETRY) | 118 if (r != FATAL && r != BOUNDED_RETRY) |
118 uw_commit(ctx); | 119 uw_commit(ctx); |
119 | 120 |