Fossil SCM
Try to avoid false-positive hung backoffice warnings from appearing in the error log.
Commit
6f1c7324b662f28f608c63a62d0111247ebd74299227ac88af687e55299f28df
Parent
a46e128c3f607be…
1 file changed
+9
-1
+9
-1
| --- src/backoffice.c | ||
| +++ src/backoffice.c | ||
| @@ -544,13 +544,21 @@ | ||
| 544 | 544 | db_end_transaction(0); |
| 545 | 545 | break; |
| 546 | 546 | } |
| 547 | 547 | }else{ |
| 548 | 548 | if( (sqlite3_uint64)(lastWarning+warningDelay) < tmNow ){ |
| 549 | - fossil_warning( | |
| 549 | + sqlite3_int64 runningFor = BKOFCE_LEASE_TIME + tmNow - x.tmCurrent; | |
| 550 | + if( warningDelay<=240 && runningFor>1800 ){ | |
| 551 | + /* On a busy system with 15-bit process-id numbers, we can sometimes | |
| 552 | + ** wrap-around the process-id space causing backofficeProcessDone() | |
| 553 | + ** to return a false negative. Try to prevent this from causing a | |
| 554 | + ** false-positive hung-backoffice warning. */ | |
| 555 | + }else{ | |
| 556 | + fossil_warning( | |
| 550 | 557 | "backoffice process %lld still running after %d seconds", |
| 551 | 558 | x.idCurrent, (int)(BKOFCE_LEASE_TIME + tmNow - x.tmCurrent)); |
| 559 | + } | |
| 552 | 560 | lastWarning = tmNow; |
| 553 | 561 | warningDelay *= 2; |
| 554 | 562 | } |
| 555 | 563 | if( backofficeSleep(1000) ){ |
| 556 | 564 | /* The sleep was interrupted by a signal from another thread. */ |
| 557 | 565 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -544,13 +544,21 @@ | |
| 544 | db_end_transaction(0); |
| 545 | break; |
| 546 | } |
| 547 | }else{ |
| 548 | if( (sqlite3_uint64)(lastWarning+warningDelay) < tmNow ){ |
| 549 | fossil_warning( |
| 550 | "backoffice process %lld still running after %d seconds", |
| 551 | x.idCurrent, (int)(BKOFCE_LEASE_TIME + tmNow - x.tmCurrent)); |
| 552 | lastWarning = tmNow; |
| 553 | warningDelay *= 2; |
| 554 | } |
| 555 | if( backofficeSleep(1000) ){ |
| 556 | /* The sleep was interrupted by a signal from another thread. */ |
| 557 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -544,13 +544,21 @@ | |
| 544 | db_end_transaction(0); |
| 545 | break; |
| 546 | } |
| 547 | }else{ |
| 548 | if( (sqlite3_uint64)(lastWarning+warningDelay) < tmNow ){ |
| 549 | sqlite3_int64 runningFor = BKOFCE_LEASE_TIME + tmNow - x.tmCurrent; |
| 550 | if( warningDelay<=240 && runningFor>1800 ){ |
| 551 | /* On a busy system with 15-bit process-id numbers, we can sometimes |
| 552 | ** wrap-around the process-id space causing backofficeProcessDone() |
| 553 | ** to return a false negative. Try to prevent this from causing a |
| 554 | ** false-positive hung-backoffice warning. */ |
| 555 | }else{ |
| 556 | fossil_warning( |
| 557 | "backoffice process %lld still running after %d seconds", |
| 558 | x.idCurrent, (int)(BKOFCE_LEASE_TIME + tmNow - x.tmCurrent)); |
| 559 | } |
| 560 | lastWarning = tmNow; |
| 561 | warningDelay *= 2; |
| 562 | } |
| 563 | if( backofficeSleep(1000) ){ |
| 564 | /* The sleep was interrupted by a signal from another thread. */ |
| 565 |