We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I write a simple program to test locker. I found locker2 can not get lock after locker1 Unlock.
locker2
locker1
Unlock
func main() { stopChan1 := make(chan struct{}) stopChan2 := make(chan struct{}) etcd.Register() s, _ := libkv.NewStore(store.ETCD, []string{"127.0.0.1:2379"}, nil) locker1, _ := s.NewLock("/test", &store.LockOptions{Value: []byte("testvalue"), TTL: 2 * time.Second}) locker2, _ := s.NewLock("/test", &store.LockOptions{Value: []byte("testvalue2"), TTL: 3 * time.Second}) fmt.Println("start lock locker1") locker1.Lock(stopChan1) fmt.Println("get locker1") go func() { fmt.Println("start lock locker2") locker2.Lock(stopChan2) fmt.Println("get locker2") locker2.Unlock() fmt.Println("unlock locker2") }() time.Sleep(3 * time.Second) fmt.Println("start unlock locker1") locker1.Unlock() fmt.Println("unlock locker1") time.Sleep(5 * time.Second) }
get locker1 start lock locker2 start unlock locker1 unlock locker1
The text was updated successfully, but these errors were encountered:
This is fixed in abronan/libkv (I tested with that example)
Sorry, something went wrong.
This should be fixed by #186 which includes a test case for this.
No branches or pull requests
I write a simple program to test locker. I found
locker2
can not get lock afterlocker1
Unlock
.The text was updated successfully, but these errors were encountered: