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.
Commit
af2f7d17493059ddfa7b103c70c1dce8faac7abe13a6bf8073f7235e15129f1d
Parent
2abb23dba8bdc5d…
1 file changed
+7
+7
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -3006,10 +3006,17 @@ | ||
| 3006 | 3006 | #ifndef _WIN32 |
| 3007 | 3007 | static int nAlarmSeconds = 0; |
| 3008 | 3008 | static void sigalrm_handler(int x){ |
| 3009 | 3009 | sqlite3_uint64 tmUser = 0, tmKernel = 0; |
| 3010 | 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 | + } | |
| 3011 | 3018 | fossil_panic("Timeout after %d seconds during %s" |
| 3012 | 3019 | " - user %,llu µs, sys %,llu µs", |
| 3013 | 3020 | nAlarmSeconds, g.zPhase, tmUser, tmKernel); |
| 3014 | 3021 | } |
| 3015 | 3022 | #endif |
| 3016 | 3023 |
| --- 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 |