Skip to content

Commit f6c5336

Browse files
committed
fix the log output when data-path is not exist or in use by another instance of nsqd
1 parent 77fe56d commit f6c5336

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/dirlock/dirlock.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func (l *DirLock) Lock() error {
2727
l.f = f
2828
err = syscall.Flock(int(f.Fd()), syscall.LOCK_EX|syscall.LOCK_NB)
2929
if err != nil {
30-
return fmt.Errorf("cannot flock directory %s - %s", l.dir, err)
30+
return fmt.Errorf("cannot flock directory %s - %s (possibly in use by another instance of nsqd)", l.dir, err)
3131
}
3232
return nil
3333
}

nsqd/nsqd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func New(opts *Options) (*NSQD, error) {
108108

109109
err = n.dl.Lock()
110110
if err != nil {
111-
return nil, fmt.Errorf("--data-path=%s in use (possibly by another instance of nsqd)", dataPath)
111+
return nil, fmt.Errorf("failed to lock data-path: %v", err)
112112
}
113113

114114
if opts.MaxDeflateLevel < 1 || opts.MaxDeflateLevel > 9 {

0 commit comments

Comments
 (0)