在这些情况下:
我有以下恐慌:
panic: close of closed channel
goroutine 2849 [running]:
github.com/samuel/go-zookeeper/zk.(*Conn).Close(0xc420795180)
github.com/samuel/go-zookeeper/zk/conn.go:253 47
github.com/curator-go/curator.(*handleHolder).internalClose(0xc4203058f0, 0xc420302470, 0x0)
github.com/curator-go/curator/state.go:136 +0x8d
github.com/curator-go/curator.(*handleHolder).closeAndReset(0xc4203058f0, 0xc42587cd00, 0x1e)
github.com/curator-go/curator/state.go:122 +0x2f
github.com/curator-go/curator.(*connectionState).reset(0xc420302420, 0x1b71d87, 0xf)
github.com/curator-go/curator/state.go:234 +0x55
github.com/curator-go/curator.(*connectionState).handleExpiredSession(0xc420302420)
github.com/curator-go/curator/state.go:351 +0xd9
github.com/curator-go/curator.(*connectionState).checkState(0xc420302420, 0xffffff90, 0x0, 0x0, 0xc425ed2600, 0xed0e5250a)
github.com/curator-go/curator/state.go:318 +0x9c
github.com/curator-go/curator.(*connectionState).process(0xc420302420, 0xc425ed2680)
github.com/curator-go/curator/state.go:299 +0x16d
created by github.com/curator-go/curator.(*Watchers).Fire
github.com/curator-go/curator/watcher.go:64 +0x96
Run Code Online (Sandbox Code Playgroud)
这是详细的事件序列:
s.ReregisterAll()
- > Conn()
- > checkTimeout()
- > reset
(bc已过去1分钟) - > closeAndReset()
- > conn.Close()
可以阻止一秒钟zk.StateExpired
(zk集群发送此bc它认为这个客户端已经死了,因为它在2期间没有ping.) - …由于在我的 Macbook Pro(最新操作系统等)上升级到 java 11,编译项目似乎经常长时间锁定整个文件系统。还有其他人有这个问题吗?任何想法如何调试它?
更新:我dtruss
在这个过程中做了一个,我看到了像这样无休止的输出。我不知道这是否重要。
gettimeofday(0x700001D00D98, 0x0, 0x0) = 0 0
gettimeofday(0x7000011DCE18, 0x0, 0x0) = 0 0
psynch_cvwait(0x7F8EF6417C10, 0x89A0100089B00, 0x0) = -1 316
gettimeofday(0x700001D00D98, 0x0, 0x0) = 0 0
psynch_cvwait(0x7F8EF6417C10, 0x89B0100089C00, 0x0) = -1 316
gettimeofday(0x700001D00D98, 0x0, 0x0) = 0 0
psynch_cvwait(0x7F8EF6417C10, 0x89C0100089D00, 0x0) = -1 316
gettimeofday(0x700001D00D98, 0x0, 0x0) = 0 0
psynch_cvwait(0x7F8EF6417C10, 0x89D0100089E00, 0x0) = -1 316
gettimeofday(0x700001D00D98, 0x0, 0x0) = 0 0
psynch_cvwait(0x7F8EF6417C10, 0x89E0100089F00, 0x0) = -1 316
Run Code Online (Sandbox Code Playgroud)
只是无休止地调用它,然后每隔一段时间:
stat64("<xxxx>.class\0", 0x700000CCBF30, 0x0) = 0 …
Run Code Online (Sandbox Code Playgroud)