Skip to content

Commit

Permalink
meta: skip cleaning session when sid is 0 (#4133)
Browse files Browse the repository at this point in the history
  • Loading branch information
SandyXSD committed Nov 24, 2023
1 parent f414481 commit be2016b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions pkg/meta/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,12 @@ func (m *baseMeta) CloseSession() error {
m.sesMu.Lock()
m.umounting = true
m.sesMu.Unlock()
logger.Infof("close session %d: %s", m.sid, m.en.doCleanStaleSession(m.sid))
return nil
var err error
if m.sid > 0 {
err = m.en.doCleanStaleSession(m.sid)
}
logger.Infof("close session %d: %s", m.sid, err)
return err
}

func (m *baseMeta) checkQuota(ctx Context, space, inodes int64, parents ...Ino) syscall.Errno {
Expand Down
2 changes: 1 addition & 1 deletion pkg/meta/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -2057,7 +2057,7 @@ func (m *dbMeta) doCleanStaleSession(sid uint64) error {
return nil
})
if err != nil {
logger.Warnf("Delete flock/plock with sid %d: %d", sid, err)
logger.Warnf("Delete flock/plock with sid %d: %s", sid, err)
fail = true
}

Expand Down

0 comments on commit be2016b

Please sign in to comment.