Fossil SCM

To avoid unnecessary clutter in the error log, do not write timeout message to the error log for timeouts that occur during web-page reply and that use less than one second of CPU time.

drh 2023-06-15 12:21 trunk
Commit af2f7d17493059ddfa7b103c70c1dce8faac7abe13a6bf8073f7235e15129f1d
1 file changed +7
+7
--- src/main.c
+++ src/main.c
@@ -3006,10 +3006,17 @@
30063006
#ifndef _WIN32
30073007
static int nAlarmSeconds = 0;
30083008
static void sigalrm_handler(int x){
30093009
sqlite3_uint64 tmUser = 0, tmKernel = 0;
30103010
fossil_cpu_times(&tmUser, &tmKernel);
3011
+ if( fossil_strcmp(g.zPhase, "web-page reply")==0
3012
+ && tmUser+tmKernel<1000000
3013
+ ){
3014
+ /* Do not log time-outs during web-page reply unless more than
3015
+ ** 1 second of CPU time has been consumed */
3016
+ return;
3017
+ }
30113018
fossil_panic("Timeout after %d seconds during %s"
30123019
" - user %,llu µs, sys %,llu µs",
30133020
nAlarmSeconds, g.zPhase, tmUser, tmKernel);
30143021
}
30153022
#endif
30163023
--- src/main.c
+++ src/main.c
@@ -3006,10 +3006,17 @@
3006 #ifndef _WIN32
3007 static int nAlarmSeconds = 0;
3008 static void sigalrm_handler(int x){
3009 sqlite3_uint64 tmUser = 0, tmKernel = 0;
3010 fossil_cpu_times(&tmUser, &tmKernel);
 
 
 
 
 
 
 
3011 fossil_panic("Timeout after %d seconds during %s"
3012 " - user %,llu µs, sys %,llu µs",
3013 nAlarmSeconds, g.zPhase, tmUser, tmKernel);
3014 }
3015 #endif
3016
--- src/main.c
+++ src/main.c
@@ -3006,10 +3006,17 @@
3006 #ifndef _WIN32
3007 static int nAlarmSeconds = 0;
3008 static void sigalrm_handler(int x){
3009 sqlite3_uint64 tmUser = 0, tmKernel = 0;
3010 fossil_cpu_times(&tmUser, &tmKernel);
3011 if( fossil_strcmp(g.zPhase, "web-page reply")==0
3012 && tmUser+tmKernel<1000000
3013 ){
3014 /* Do not log time-outs during web-page reply unless more than
3015 ** 1 second of CPU time has been consumed */
3016 return;
3017 }
3018 fossil_panic("Timeout after %d seconds during %s"
3019 " - user %,llu µs, sys %,llu µs",
3020 nAlarmSeconds, g.zPhase, tmUser, tmKernel);
3021 }
3022 #endif
3023

Keyboard Shortcuts

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