Fossil SCM

Try to avoid false-positive hung backoffice warnings from appearing in the error log.

drh 2025-03-31 18:49 trunk
Commit 6f1c7324b662f28f608c63a62d0111247ebd74299227ac88af687e55299f28df
1 file changed +9 -1
--- src/backoffice.c
+++ src/backoffice.c
@@ -544,13 +544,21 @@
544544
db_end_transaction(0);
545545
break;
546546
}
547547
}else{
548548
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(
550557
"backoffice process %lld still running after %d seconds",
551558
x.idCurrent, (int)(BKOFCE_LEASE_TIME + tmNow - x.tmCurrent));
559
+ }
552560
lastWarning = tmNow;
553561
warningDelay *= 2;
554562
}
555563
if( backofficeSleep(1000) ){
556564
/* The sleep was interrupted by a signal from another thread. */
557565
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button