mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 02:27:26 +01:00
weed: flush buffered log lines when a command exits (#13151)
exit() ends the process with os.Exit, which skips deferred calls, and glog writes its files only every 30s. A short-lived command such as a piped weed shell session lost every log line it buffered, including the daily_run summary of s3.lifecycle.run-shard. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
edbcc718d3
commit
d4a21cef59
1 file changed
+3
-1
+3
-1
@@ -221,7 +221,9 @@ func exit() {
|
||||
for _, f := range atexitFuncs {
|
||||
f()
|
||||
}
|
||||
// os.Exit below skips main's deferred flush.
|
||||
// os.Exit below skips main's deferred flush, and glog only flushes its
|
||||
// files every 30s, so a short command would lose its log lines.
|
||||
glog.Flush()
|
||||
sentry.Flush(2 * time.Second)
|
||||
os.Exit(exitStatus)
|
||||
}
|
||||
Reference in new issue
Block a user