Comments (5)
@meirf: i have not looked into the various race conditions myself as I am not a user of curator anymore.
However I am willing to look into PR's by people which are complemented by unit tests to keep this project alive.
from curator.
@basvanbeek , any idea on how to resolve this?
I'm seeing this:
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
from curator.
I've figured out what the race condition is, but I'm not sure the best solution to submit for PR. Perhaps you can give me a hint if you would be so kind since I'm not as familiar with this library.
Here are the details. Please let me know if I've said anything invalid.
- The client loses network connectivity to zk.
- One minute passes.
- The client regains network connectivity to zk.
- goroutine A calls
s.ReregisterAll()
->Conn()
->checkTimeout()
->reset
(bc 1 minute has elapsed) ->closeAndReset()
->conn.Close()
which can block for a second - goroutine B handles
zk.StateExpired
(zk cluster sends this bc it considers this client as dead since it didn't ping during 2.) ->reset
->closeAndReset()
->conn.Close()
which causes a panic becauseconn.Close()
already closed the connection'sc.shouldQuit
channel ANDs.zooKeeper.getZookeeperConnection
was never called by goroutine A because it was blocking for the second so there's no new connection?
I'd be happy to submit a PR if you have me a hint as to appropriate solution.
from curator.
hey @tevino , I'm not having any luck. Do you have any ideas? Here is a rundown.
from curator.
I've switched all my projects interacting with Zookeeper from go-curator to a library I made myself, and it turns out much easier than fixing various glitches of a project which nobody maintains actively.
It's a shame that this promising project is rotten.
FYI @meirf
from curator.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from curator.