Skip to content

Commit 79df02b

Browse files
authored
[ws-daemon] additional logging for markunmount (#18486)
Relates to ENG-473
1 parent ec7f6d6 commit 79df02b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

components/ws-daemon/pkg/daemon/markunmount.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,15 @@ func unmountMark(instanceID string) error {
139139
path := fromPartialMount(filepath.Join(dir, "mark"), mounts)
140140
// empty path means no mount found
141141
if len(path) == 0 {
142+
log.WithFields(log.OWI("", "", instanceID)).Info("no mount found")
142143
return nil
143144
}
144145

145146
// in some scenarios we need to wait for the unmount
146-
var errorFn = func(err error) bool {
147+
var canRetryFn = func(err error) bool {
148+
if !strings.Contains(err.Error(), "device or resource busy") {
149+
log.WithError(err).WithFields(log.OWI("", "", instanceID)).Info("Will not retry unmount mark")
150+
}
147151
return strings.Contains(err.Error(), "device or resource busy")
148152
}
149153

@@ -157,7 +161,7 @@ func unmountMark(instanceID string) error {
157161
Duration: 1 * time.Second,
158162
Factor: 5.0,
159163
Jitter: 0.1,
160-
}, errorFn, func() error {
164+
}, canRetryFn, func() error {
161165
return unix.Unmount(p, 0)
162166
})
163167
})

0 commit comments

Comments
 (0)