File tree Expand file tree Collapse file tree 3 files changed +7
-12
lines changed
Expand file tree Collapse file tree 3 files changed +7
-12
lines changed Original file line number Diff line number Diff line change 44
55** Bug Fixes**
66- Fix panic while reading an archived blob using file-cache ([ PR #2127 ] ( https://github.com/Azure/azure-storage-fuse/pull/2127 )]
7+ - Ensure logger is properly deinitialized on mount failures ([ PR #2125 ] ( https://github.com/Azure/azure-storage-fuse/pull/2125 )]
78
89## 2.5.2 (2026-01-19)
910** Features**
Original file line number Diff line number Diff line change @@ -440,6 +440,12 @@ var mountCmd = &cobra.Command{
440440 return fmt .Errorf ("failed to initialize logger [%s]" , err .Error ())
441441 }
442442
443+ // It's best to destroy the logger before we return to the caller, as caller may abruptly exit on error and we
444+ // might lose some logs in the channel which are not yet flushed to the file in case of not destroying the logger
445+ defer func () {
446+ _ = log .Destroy ()
447+ }()
448+
443449 if ! disableVersionCheck {
444450 err := VersionCheck ()
445451 if err != nil {
Original file line number Diff line number Diff line change @@ -35,23 +35,11 @@ package main
3535
3636import (
3737 "github.com/Azure/azure-storage-fuse/v2/cmd"
38- "github.com/Azure/azure-storage-fuse/v2/common/log"
3938)
4039
4140//go:generate ./cmd/componentGenerator.sh $NAME
4241// To use go:generate run command "NAME="component" go generate"
4342
4443func main () {
45- defer log .Destroy () // nolint:errcheck
46- // This recovers the panics only for the functions that run within this context. all the go-routine
47- // spawned by this function need to handle their panics separately if required. Also the FUSE callbacks
48- // wouldn't run in this context, so the panics originated from the callbacks can't get recovered here.
49- defer func () {
50- if panicErr := recover (); panicErr != nil {
51- log .Crit ("PANIC: %v" , panicErr )
52- panic (panicErr )
53- }
54- }()
55-
5644 _ = cmd .Execute ()
5745}
You can’t perform that action at this time.
0 commit comments