diff --git a/go.mod b/go.mod index ad32b6c..ae41604 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,10 @@ module github.com/SystemBuilders/LocKey go 1.14 require ( + github.com/davecgh/go-spew v1.1.1 // indirect github.com/gorilla/mux v1.7.4 + github.com/kr/pretty v0.1.0 // indirect github.com/rs/zerolog v1.19.0 + github.com/stretchr/testify v1.6.1 + gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect ) diff --git a/go.sum b/go.sum index 4284e25..f5cf236 100644 --- a/go.sum +++ b/go.sum @@ -1,10 +1,25 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.19.0 h1:hYz4ZVdUgjXTBUmrkrw55j1nHx68LfOKIQk5IYtyScg= github.com/rs/zerolog v1.19.0/go.mod h1:IzD0RJ65iWH0w97OQQebJEvTZYvsCUm9WVLWBQrJRjo= +github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -12,3 +27,9 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20190828213141-aed303cbaa74/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/cache/cache.go b/internal/cache/cache.go index 679e88f..80b75f5 100644 --- a/internal/cache/cache.go +++ b/internal/cache/cache.go @@ -6,7 +6,7 @@ type Cache interface { // Getting the object makes it the most recently used object // in the cache. This function must be implemented in O(1) complexity. // If the object doesn't exist in the cache, an error is raised. - GetElement(element interface{}) error + GetElement(element interface{}) (string, error) // PutElement inserts an object into the cache. // Putting the object makes it the most recently used object // in the cache. This function must be implemented in O(1) complexity. diff --git a/internal/cache/dll.go b/internal/cache/dll.go index 709d5bb..37afc56 100644 --- a/internal/cache/dll.go +++ b/internal/cache/dll.go @@ -10,6 +10,7 @@ var _ Key = (*SimpleKey)(nil) // SimpleKey implements a Key interface. type SimpleKey struct { + Owner string Value string } @@ -19,9 +20,10 @@ func (sk *SimpleKey) Data() string { } // NewSimpleKey returns a new SimpleKey of the given value. -func NewSimpleKey(val string) *SimpleKey { +func NewSimpleKey(val, owner string) *SimpleKey { return &SimpleKey{ Value: val, + Owner: owner, } } diff --git a/internal/cache/dll_test.go b/internal/cache/dll_test.go index b268057..624ec10 100644 --- a/internal/cache/dll_test.go +++ b/internal/cache/dll_test.go @@ -5,37 +5,37 @@ import "testing" func Test_DLL(t *testing.T) { dllNode := NewDoublyLinkedList() - dllNode.InsertNodeToRight(nil, &SimpleKey{"1"}) + dllNode.InsertNodeToRight(nil, &SimpleKey{Value: "1"}) dllNode.PrintLinkedList() if dllNode.Head.Key().Data() != "1" { t.Errorf("Required value \"1\", got %s", dllNode.Head.Key()) } - dllNode.InsertNodeToLeft(dllNode.Head, &SimpleKey{"2"}) + dllNode.InsertNodeToLeft(dllNode.Head, &SimpleKey{Value: "2"}) dllNode.PrintLinkedList() dllNode.DeleteNode(dllNode.Head.Right()) dllNode.PrintLinkedList() - dllNode.InsertNodeToLeft(dllNode.Head, &SimpleKey{"1"}) + dllNode.InsertNodeToLeft(dllNode.Head, &SimpleKey{Value: "1"}) dllNode.PrintLinkedList() - dllNode.InsertNodeToLeft(dllNode.Head, &SimpleKey{"3"}) + dllNode.InsertNodeToLeft(dllNode.Head, &SimpleKey{Value: "3"}) dllNode.PrintLinkedList() dllNode.DeleteNode(dllNode.Head.Right().Right()) dllNode.PrintLinkedList() - dllNode.InsertNodeToLeft(dllNode.Head, &SimpleKey{"2"}) + dllNode.InsertNodeToLeft(dllNode.Head, &SimpleKey{Value: "2"}) dllNode.PrintLinkedList() - dllNode.InsertNodeToLeft(dllNode.Head, &SimpleKey{"4"}) + dllNode.InsertNodeToLeft(dllNode.Head, &SimpleKey{Value: "4"}) dllNode.PrintLinkedList() dllNode.DeleteNode(dllNode.Head.Right().Right().Right()) dllNode.PrintLinkedList() - dllNode.InsertNodeToLeft(dllNode.Head, &SimpleKey{"1"}) + dllNode.InsertNodeToLeft(dllNode.Head, &SimpleKey{Value: "1"}) dllNode.PrintLinkedList() } diff --git a/internal/cache/error.go b/internal/cache/error.go index e5e7cbb..b5a0fa3 100644 --- a/internal/cache/error.go +++ b/internal/cache/error.go @@ -10,4 +10,5 @@ func (e Error) Error() string { return string(e) } const ( ErrElementDoesntExist = Error("element doesn't exist in the cache") ErrElementAlreadyExists = Error("element already exists in the cache") + ErrCacheDoesntExist = Error("cache doesn't exist") ) diff --git a/internal/cache/lru_cache.go b/internal/cache/lru_cache.go index ece7809..870229b 100644 --- a/internal/cache/lru_cache.go +++ b/internal/cache/lru_cache.go @@ -1,6 +1,9 @@ package cache -import "fmt" +import ( + "fmt" + "sync" +) var _ Cache = (*LRUCache)(nil) @@ -30,6 +33,7 @@ type LRUCache struct { tail *DLLNode m map[interface{}]*DLLNode dll *DoublyLinkedList + mu sync.Mutex } // NewLRUCache creates a new LRUCache of provided size. @@ -50,10 +54,14 @@ func NewLRUCache(capacity int) *LRUCache { // // The element is removed from the map too because // it might have stale node values. -func (lru *LRUCache) GetElement(element interface{}) error { +// +// Error is returned only if the element doesn't exist in the cache. +func (lru *LRUCache) GetElement(element interface{}) (string, error) { // Check whether the element exists in the cache. - if _, ok := lru.m[*element.(*SimpleKey)]; ok { - nodeOfKey := lru.m[*element.(*SimpleKey)] + lru.mu.Lock() + defer lru.mu.Unlock() + if node, ok := lru.m[*&element.(*SimpleKey).Value]; ok { + nodeOfKey := lru.m[*&element.(*SimpleKey).Value] // Check whether the currently accessed element is the // most recently used element in the cache. If it's not, // it must be moved to the MRU to accomodate the protocol. @@ -65,22 +73,17 @@ func (lru *LRUCache) GetElement(element interface{}) error { // delete the old key so that it can be moved to MRU. lru.dll.DeleteNode(nodeOfKey) - lru.deleteElementFromMap(*nodeOfKey.Key().(*SimpleKey)) + lru.deleteElementFromMap(*&nodeOfKey.Key().(*SimpleKey).Value) // Move the currently accessed node to the MRU position. // The start pointer doesn't change as it still points to // the LRU element. lru.dll.InsertNodeToLeft(lru.dll.Head, nodeOfKey.NodeKey) - lru.insertElementIntoMap(*element.(*SimpleKey), lru.dll.Head) - - // headRight := lru.dll.Head.Right() - // if headRight != nil { - // lru.insertElementIntoMap(headRight.Key(), headRight) - // } + lru.insertElementIntoMap(*&element.(*SimpleKey).Value, lru.dll.Head) } - return nil + return node.NodeKey.Owner, nil } - return ErrElementDoesntExist + return "", ErrElementDoesntExist } // PutElement inserts an element in the cache. @@ -89,28 +92,31 @@ func (lru *LRUCache) GetElement(element interface{}) error { // Removal of the LRU is done my deleting the tail node, // making place for a new node. func (lru *LRUCache) PutElement(element interface{}) error { + lru.mu.Lock() + defer lru.mu.Unlock() if !lru.full { if lru.dll.Head == nil { lru.dll.InsertNodeToRight(lru.dll.Head, element.(*SimpleKey)) - err := lru.insertElementIntoMap(*element.(*SimpleKey), lru.dll.Head) + err := lru.insertElementIntoMap(*&element.(*SimpleKey).Value, lru.dll.Head) if err != nil { return err } lru.tail = lru.dll.Head.(*DLLNode) } else { lru.dll.InsertNodeToLeft(lru.dll.Head, element.(*SimpleKey)) - err := lru.insertElementIntoMap(*element.(*SimpleKey), lru.dll.Head) + err := lru.insertElementIntoMap(*&element.(*SimpleKey).Value, lru.dll.Head) if err != nil { return err } } + lru.size++ if lru.size == lru.capacity { lru.full = true } } else { lru.dll.InsertNodeToLeft(lru.dll.Head, element.(*SimpleKey)) - err := lru.insertElementIntoMap(*element.(*SimpleKey), lru.dll.Head) + err := lru.insertElementIntoMap(*&element.(*SimpleKey).Value, lru.dll.Head) if err != nil { return err } @@ -120,18 +126,20 @@ func (lru *LRUCache) PutElement(element interface{}) error { // Delete the "start" node and make the newly inserted node the MRU node. lru.dll.DeleteNode(tailNode) - lru.deleteElementFromMap(*tailNode.Key().(*SimpleKey)) + lru.deleteElementFromMap(*&tailNode.Key().(*SimpleKey).Value) } return nil } -// RemoveElement() deletes a node from the cache based on a key value +// RemoveElement deletes a node from the cache based on a key value // If there are multiple nodes with the same value, the node that was // most recently used will be removed. func (lru *LRUCache) RemoveElement(element interface{}) error { + lru.mu.Lock() + defer lru.mu.Unlock() // Check if the node exists in the cache - if _, ok := lru.m[*element.(*SimpleKey)]; ok { - nodeOfKey := lru.m[*element.(*SimpleKey)] + if _, ok := lru.m[*&element.(*SimpleKey).Value]; ok { + nodeOfKey := lru.m[*&element.(*SimpleKey).Value] // If there is only one element in the linked list, make the // tail point to nil // @@ -142,8 +150,10 @@ func (lru *LRUCache) RemoveElement(element interface{}) error { } else if lru.tail == nodeOfKey { lru.tail = nodeOfKey.LeftNode.(*DLLNode) } + // lru.PrintCache() + lru.size-- lru.dll.DeleteNode(nodeOfKey) - lru.deleteElementFromMap(*nodeOfKey.Key().(*SimpleKey)) + lru.deleteElementFromMap(*&nodeOfKey.Key().(*SimpleKey).Value) return nil } diff --git a/internal/cache/lru_cache_test.go b/internal/cache/lru_cache_test.go index c79b9e5..328bf90 100644 --- a/internal/cache/lru_cache_test.go +++ b/internal/cache/lru_cache_test.go @@ -5,13 +5,13 @@ import "testing" func Test_LRUCache(t *testing.T) { lruCache := NewLRUCache(5) - one := NewSimpleKey("1") - two := NewSimpleKey("2") - three := NewSimpleKey("3") - four := NewSimpleKey("4") - one_1 := NewSimpleKey("1") - five := NewSimpleKey("5") - six := NewSimpleKey("6") + one := NewSimpleKey("1", "owner1") + two := NewSimpleKey("2", "owner1") + three := NewSimpleKey("3", "owner1") + four := NewSimpleKey("4", "owner1") + oneOne := NewSimpleKey("1", "owner1") + five := NewSimpleKey("5", "owner1") + six := NewSimpleKey("6", "owner1") err := lruCache.PutElement(one) if err != nil { @@ -25,7 +25,7 @@ func Test_LRUCache(t *testing.T) { } lruCache.PrintCache() - err = lruCache.GetElement(one) + _, err = lruCache.GetElement(one) if err != nil { t.Fatal(err) } @@ -37,7 +37,7 @@ func Test_LRUCache(t *testing.T) { } lruCache.PrintCache() - err = lruCache.GetElement(two) + _, err = lruCache.GetElement(two) if err != nil { t.Fatal(err) } @@ -49,25 +49,25 @@ func Test_LRUCache(t *testing.T) { } lruCache.PrintCache() - err = lruCache.GetElement(one) + _, err = lruCache.GetElement(one) if err != nil { t.Fatal(err) } lruCache.PrintCache() - err = lruCache.GetElement(three) + _, err = lruCache.GetElement(three) if err != nil { t.Fatal(err) } lruCache.PrintCache() - err = lruCache.GetElement(four) + _, err = lruCache.GetElement(four) if err != nil { t.Fatal(err) } lruCache.PrintCache() - err = lruCache.RemoveElement(one_1) + err = lruCache.RemoveElement(oneOne) if err != nil { t.Fatal(err) } diff --git a/internal/lockclient/1.bash b/internal/lockclient/1.bash new file mode 100644 index 0000000..41fdcac --- /dev/null +++ b/internal/lockclient/1.bash @@ -0,0 +1,4 @@ +for i in {1..10} +do + go test -race -run TestLockService >> logs +done diff --git a/internal/lockclient/client.go b/internal/lockclient/client.go index 0005fe6..eb1a181 100644 --- a/internal/lockclient/client.go +++ b/internal/lockclient/client.go @@ -4,7 +4,18 @@ import "github.com/SystemBuilders/LocKey/internal/lockservice" // Client describes a client that can be used to interact with // the Lockey lockservice. The client can start the lockservice -// and interact acquire and release locks by making calls to it. +// and interact by making calls to it. +// +// The client has the ability to start the lockservice from its +// in-built function or it can be started separately. +// +// The client offers the user to Acquire a lock, Release a lock, +// and Watch or Pounce on any object using it's descriptor. +// +// To acquire a lock on an object, the user is forced to go via +// the Pounce function in order to maintain the order of lock +// acquisition. The Acquire function that is exposed must cleverly +// handle this problem. type Client interface { // StartService starts the lockservice Lockey using the given // configuration. It provides an appropriate error on failing @@ -19,6 +30,22 @@ type Client interface { // implementation interacts with the underlying server and // provides the service. Release(lockservice.Descriptors) error + // Watch can be used to watch the state of lock on a descriptor + // continously. When the state of the lock changes, the "watcher" + // will be notified about the change. + // The channel passed as the argument can be used to stop watching + // at any point of time. + watch(lockservice.ObjectDescriptor, chan struct{}) (chan Lock, error) + // Pounce can be used to "pounce" on a lock that has already been + // acquired. This is similar to acquire but once a process has + // opted to pounce, they will be provided first access by having + // a queue of pouncers. + // The second, third and fourth arguments dictate the end of the pouncing + // reign, the owner willing to pounce and allows pouncing on pre-pounced + // objects respectively. True bool allows pouncing on pre-pounced objects. + pounce(lockservice.ObjectDescriptor, string, chan struct{}, bool) error + // Pouncers returns the current pouncers on any particular lock. + pouncers(lockservice.ObjectDescriptor) []string } // Config describes the configuration for the lockservice to run on. @@ -28,3 +55,18 @@ type Config interface { // Port provides the port where the server is supposed to run. Port() string } + +// State describes the state of a lock. +type State int + +// These are the states of a lock. +const ( + acquire State = iota + Release +) + +// Lock includes the state of the lock and the owner. +type Lock struct { + Owner string + LockState State +} diff --git a/internal/lockclient/errors.go b/internal/lockclient/errors.go new file mode 100644 index 0000000..ab2a9d6 --- /dev/null +++ b/internal/lockclient/errors.go @@ -0,0 +1,12 @@ +package lockclient + +// Error provides constant error strings to the driver functions. +type Error string + +func (e Error) Error() string { return string(e) } + +// Constant errors. +// Rule of thumb, all errors start with a small letter and end with no full stop. +const ( + ErrorObjectAlreadyPouncedOn = Error("the object already has a minimum of one pouncer") +) diff --git a/internal/lockclient/logs b/internal/lockclient/logs new file mode 100644 index 0000000..f4fd23b --- /dev/null +++ b/internal/lockclient/logs @@ -0,0 +1,2890 @@ +2020/08/23 16:24:02 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:24:02+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:02+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:24:02+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:02+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:24:02+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:02+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T16:24:02+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:24:02+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:02+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:24:02+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:02+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:24:02+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:02+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T16:24:02+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T16:24:02+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T16:24:02+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:24:02+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T16:24:02+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:24:02+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T16:24:03+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:24:03+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:03+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:03+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:03+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:24:03+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:24:03+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:24:03+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:24:03+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:05+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T16:24:05+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T16:24:05+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:24:05+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:24:05+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:05+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T16:24:05+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:07+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:07+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:24:07+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T16:24:07+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:24:07+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:24:07+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:24:07+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T16:24:08+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T16:24:08+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:24:08+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T16:24:08+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T16:24:08+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T16:24:09+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:24:09+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:24:09+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:24:09+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T16:24:09+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:24:09+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T16:24:09+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T16:24:09+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:24:09+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:24:12+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T16:24:12+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:24:12+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T16:24:12+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","time":"2020-08-23T16:24:12+05:30","message":"stopped watching"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T16:24:14+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T16:24:14+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:24:14+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T16:24:14+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:24:14+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T16:24:16+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:24:16+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:24:16+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:24:16+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","time":"2020-08-23T16:24:16+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:24:16+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:24:16+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:24:16+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:24:16+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:24:16+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:24:20+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:24:20+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:24:20+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:24:20+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T16:24:20+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:24:20+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:24:20+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:24:20+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:24:20+05:30","message":"stopped watching"} +--- FAIL: TestLockService (19.79s) + --- FAIL: TestLockService/pounce_test_with_quitting_in_between,_without_waiting_for_object (7.83s) + simple_client_test.go:390: + Error Trace: simple_client_test.go:390 + Error: Not equal: + expected: []string{"owner1", "owner2"} + actual : []string{"owner1", "owner2", "owner3"} + + Diff: + --- Expected + +++ Actual + @@ -1,4 +1,5 @@ + -([]string) (len=2) { + +([]string) (len=3) { + (string) (len=6) "owner1", + - (string) (len=6) "owner2" + + (string) (len=6) "owner2", + + (string) (len=6) "owner3" + } + Test: TestLockService/pounce_test_with_quitting_in_between,_without_waiting_for_object +FAIL +exit status 1 +FAIL github.com/SystemBuilders/LocKey/internal/lockclient 19.907s +2020/08/23 16:24:23 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:24:23+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:23+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:24:23+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:23+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:24:23+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:23+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T16:24:23+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:24:23+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:23+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:24:23+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:23+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:24:23+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:23+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T16:24:23+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T16:24:23+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T16:24:23+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:24:23+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T16:24:23+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:24:23+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T16:24:24+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:24:24+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:25+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:25+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:25+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:24:25+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:24:25+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:24:25+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:24:25+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:27+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T16:24:27+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:27+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:24:27+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:27+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:24:27+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:24:27+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:29+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:29+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:29+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:24:29+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T16:24:29+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:24:29+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:24:29+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:24:29+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:24:29+05:30","message":"stopped watching"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T16:24:30+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T16:24:30+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:24:30+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T16:24:30+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T16:24:30+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T16:24:30+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:24:30+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:24:31+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:24:31+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:24:31+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T16:24:31+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T16:24:31+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:24:33+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:24:33+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:24:33+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T16:24:33+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T16:24:33+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:24:33+05:30","message":"stopped watching"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T16:24:36+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T16:24:36+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:24:36+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T16:24:36+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:24:36+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T16:24:37+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:24:37+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:24:37+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:24:37+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:24:37+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:24:37+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T16:24:37+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","time":"2020-08-23T16:24:37+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:24:37+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:24:37+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:24:37+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:24:37+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:24:39+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:24:40+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:24:40+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T16:24:40+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:24:40+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:24:40+05:30","message":"stopped watching"} +PASS +ok github.com/SystemBuilders/LocKey/internal/lockclient 21.075s +2020/08/23 16:24:45 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:24:45+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:45+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:24:45+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:45+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:24:45+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:24:45+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:24:45+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:45+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:24:45+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:45+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:24:45+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:45+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T16:24:45+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T16:24:45+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T16:24:45+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:24:45+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T16:24:45+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:24:45+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T16:24:46+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:24:46+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:47+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:47+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:24:47+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T16:24:47+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:24:47+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:24:47+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:47+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:24:47+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:49+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:49+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T16:24:49+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:24:49+05:30","message":"lock is in acquired state"} +{"level":"debug","owner":"owner2","time":"2020-08-23T16:24:49+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:24:49+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:24:49+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:24:51+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:24:51+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T16:24:51+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:24:51+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:24:51+05:30","message":"stopped watching"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T16:24:52+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T16:24:52+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:24:52+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T16:24:52+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T16:24:52+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T16:24:52+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:24:52+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:24:53+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:24:53+05:30","message":"lock is in released state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:24:53+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T16:24:53+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T16:24:53+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:24:55+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:24:55+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T16:24:55+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:24:55+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T16:24:55+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T16:24:55+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:24:55+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T16:24:57+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T16:24:57+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:24:57+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T16:24:57+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:24:57+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T16:24:58+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:24:58+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:24:58+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:24:58+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:24:58+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:24:58+05:30","message":"pounce success"} +{"level":"debug","time":"2020-08-23T16:24:58+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:24:58+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:24:58+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:24:58+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:00+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:00+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:00+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:25:00+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T16:25:00+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:25:00+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:25:00+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:25:00+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:25:00+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +PASS +ok github.com/SystemBuilders/LocKey/internal/lockclient 17.427s +2020/08/23 16:25:03 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:25:04+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:04+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","time":"2020-08-23T16:25:04+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:25:04+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:04+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:25:04+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:04+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:25:04+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:04+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T16:25:04+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T16:25:04+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T16:25:04+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:25:04+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T16:25:04+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:25:04+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T16:25:04+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:25:04+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:05+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:05+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:05+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:25:05+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:25:05+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:25:05+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:25:05+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:07+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T16:25:07+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T16:25:07+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:25:07+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:25:07+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:25:07+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:25:07+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:09+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:25:09+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:25:09+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:25:09+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T16:25:09+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","time":"2020-08-23T16:25:09+05:30","message":"stopped watching"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T16:25:10+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T16:25:10+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:25:10+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T16:25:10+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T16:25:10+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T16:25:10+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:25:10+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:25:11+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:25:11+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:25:11+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T16:25:11+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T16:25:11+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:25:14+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:25:14+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:25:14+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T16:25:14+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T16:25:14+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:25:14+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T16:25:14+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T16:25:16+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T16:25:16+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:25:16+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T16:25:16+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:25:16+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T16:25:17+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:25:17+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:17+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:17+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:17+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:25:17+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:25:17+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","time":"2020-08-23T16:25:18+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:25:18+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:25:18+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:19+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:19+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:25:20+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T16:25:20+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:20+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:25:20+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:25:20+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:25:20+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +PASS +ok github.com/SystemBuilders/LocKey/internal/lockclient 18.087s +2020/08/23 16:25:23 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:25:23+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:23+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:25:23+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:23+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:25:23+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:23+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","time":"2020-08-23T16:25:23+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:25:23+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:23+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:25:23+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:23+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:25:23+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:23+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T16:25:23+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T16:25:23+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T16:25:23+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:25:23+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T16:25:23+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:25:23+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T16:25:23+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:25:23+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:24+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:24+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:25:24+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:25:24+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:25:24+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:25:24+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:26+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:26+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T16:25:26+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:25:26+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:25:26+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:25:26+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:28+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:28+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:28+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:25:28+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T16:25:28+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:25:28+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:25:28+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:25:28+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:25:28+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T16:25:29+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T16:25:29+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:25:29+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T16:25:29+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T16:25:29+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T16:25:29+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:25:29+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:25:30+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:25:30+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T16:25:30+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T16:25:30+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:25:30+05:30","message":"pounce success"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:25:32+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:25:32+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T16:25:32+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:25:32+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T16:25:32+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T16:25:32+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:25:32+05:30","message":"stopped watching"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T16:25:34+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T16:25:34+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:25:34+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T16:25:36+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:25:36+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T16:25:36+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:25:36+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:36+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:36+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:36+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:25:36+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T16:25:36+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:25:36+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:25:36+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:25:36+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:25:36+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:25:36+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:39+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:39+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:25:40+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T16:25:40+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:25:40+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:25:40+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:25:40+05:30","message":"stopped watching"} +PASS +ok github.com/SystemBuilders/LocKey/internal/lockclient 18.952s +2020/08/23 16:25:43 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:25:43+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:43+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:25:43+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:25:43+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:43+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T16:25:43+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:25:43+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:43+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:25:43+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:43+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:25:43+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:43+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T16:25:43+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T16:25:43+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T16:25:43+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:25:43+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T16:25:43+05:30","message":"beginning pounce"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T16:25:43+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:25:43+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:25:43+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:44+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:25:44+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:25:44+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:25:44+05:30","message":"lock is in acquired state"} +{"level":"debug","owner":"owner1","time":"2020-08-23T16:25:44+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:25:44+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:25:44+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:46+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:46+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T16:25:46+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:25:46+05:30","message":"lock is in acquired state"} +{"level":"debug","owner":"owner2","time":"2020-08-23T16:25:46+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:25:46+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:25:46+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:25:48+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:25:48+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T16:25:48+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:25:48+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:25:48+05:30","message":"stopped watching"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T16:25:49+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T16:25:49+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:25:49+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T16:25:49+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T16:25:49+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T16:25:50+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:25:50+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:25:50+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:25:50+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:25:50+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T16:25:50+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T16:25:50+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:25:52+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:25:52+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T16:25:52+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T16:25:52+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:25:52+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T16:25:52+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T16:25:54+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T16:25:54+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:25:54+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T16:25:54+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:25:54+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T16:25:55+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:25:55+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:55+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:55+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:55+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:25:55+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:25:55+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:25:55+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:25:55+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:25:55+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:57+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:57+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:25:57+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:25:59+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T16:25:59+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:25:59+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:25:59+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:25:59+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:25:59+05:30","message":"lock is in acquired state"} +PASS +ok github.com/SystemBuilders/LocKey/internal/lockclient 16.644s +2020/08/23 16:26:01 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:26:01+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:01+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","time":"2020-08-23T16:26:01+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:26:01+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:01+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:26:01+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:01+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:26:01+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:01+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T16:26:01+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T16:26:01+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T16:26:01+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:26:01+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T16:26:01+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:26:01+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T16:26:02+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:26:02+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:02+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:02+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:26:02+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:26:02+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:26:02+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:26:02+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:04+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:04+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:04+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T16:26:04+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T16:26:04+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:26:04+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:26:04+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:26:04+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:26:04+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:06+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:06+05:30","message":"lock is in released state"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:26:06+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T16:26:06+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:26:06+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:26:06+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:26:06+05:30","message":"stopped watching"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T16:26:07+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T16:26:07+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:26:07+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T16:26:07+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T16:26:07+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T16:26:07+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:26:07+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:26:08+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:26:08+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T16:26:08+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:26:08+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T16:26:08+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:26:10+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:26:10+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:26:10+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T16:26:10+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T16:26:10+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:26:10+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T16:26:10+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T16:26:14+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T16:26:14+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:26:14+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T16:26:14+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:26:14+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T16:26:14+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:26:14+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:26:17+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:26:17+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:26:17+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:26:17+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:26:17+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:26:17+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:26:17+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:26:17+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:26:23+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:26:23+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:26:23+05:30","message":"lock is in released state"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:26:23+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T16:26:23+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:26:23+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:26:23+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:26:23+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:26:23+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +PASS +ok github.com/SystemBuilders/LocKey/internal/lockclient 24.554s +2020/08/23 16:26:27 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:26:27+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:27+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","time":"2020-08-23T16:26:27+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:26:27+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:27+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:26:27+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:27+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:26:27+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:27+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T16:26:27+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T16:26:27+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T16:26:27+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:26:27+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T16:26:28+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:26:28+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T16:26:28+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:26:28+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:28+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:28+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:28+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:26:28+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T16:26:28+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:26:28+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:26:28+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:26:28+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:26:28+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:30+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:30+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T16:26:30+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:26:30+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:26:30+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:32+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:26:32+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:26:32+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T16:26:32+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:32+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T16:26:32+05:30","message":"stopped watching"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T16:26:33+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T16:26:33+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:26:33+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T16:26:34+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T16:26:34+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T16:26:34+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:26:34+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:26:35+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:26:35+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:26:35+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T16:26:35+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T16:26:35+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:26:37+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:26:37+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:26:37+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T16:26:37+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T16:26:37+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T16:26:37+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:26:37+05:30","message":"stopped watching"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T16:26:40+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T16:26:40+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:26:40+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T16:26:40+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:26:40+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T16:26:41+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:26:41+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:26:41+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:26:41+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:26:41+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","time":"2020-08-23T16:26:42+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:26:42+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:26:42+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:26:42+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:26:42+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:26:44+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:26:44+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:26:44+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:26:44+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T16:26:44+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:26:44+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:26:44+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:26:44+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:26:44+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +PASS +ok github.com/SystemBuilders/LocKey/internal/lockclient 18.614s +2020/08/23 16:26:47 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:26:47+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:47+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:26:47+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:47+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:26:47+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:47+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T16:26:47+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:26:47+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:47+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:26:47+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:47+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:26:47+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:47+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T16:26:47+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T16:26:47+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T16:26:47+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:26:47+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T16:26:47+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:26:47+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T16:26:48+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:26:48+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:48+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:48+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:48+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:26:48+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:26:48+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:26:48+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:26:48+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:50+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:50+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:50+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T16:26:50+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:26:50+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:26:50+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:26:50+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:53+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:26:53+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T16:26:53+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:26:53+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:26:53+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T16:26:53+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:26:53+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T16:26:54+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T16:26:54+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:26:54+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T16:26:54+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T16:26:54+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T16:26:55+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:26:55+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:26:55+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:26:55+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:26:55+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T16:26:55+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T16:26:55+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:26:57+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:26:57+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:26:57+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T16:26:57+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T16:26:57+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T16:26:57+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:26:57+05:30","message":"stopped watching"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T16:26:59+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T16:26:59+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:26:59+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T16:26:59+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:26:59+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T16:27:00+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:27:00+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:27:00+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:27:00+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:27:00+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:27:00+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T16:27:00+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:27:00+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:27:00+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:27:00+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:27:00+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","time":"2020-08-23T16:27:00+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:27:02+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:27:02+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:27:02+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T16:27:02+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:27:02+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:27:02+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:27:02+05:30","message":"lock is in acquired state"} +PASS +ok github.com/SystemBuilders/LocKey/internal/lockclient 17.658s +2020/08/23 16:27:06 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:27:06+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:27:06+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","time":"2020-08-23T16:27:06+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:27:06+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:27:06+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:27:06+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:27:06+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:27:06+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:27:06+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T16:27:06+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T16:27:06+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T16:27:06+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:27:06+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T16:27:06+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:27:06+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T16:27:06+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T16:27:06+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:27:07+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:27:07+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:27:07+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:27:07+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:27:07+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T16:27:07+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:27:09+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:27:09+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:27:09+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T16:27:09+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:27:09+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:27:09+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T16:27:09+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:27:11+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:27:11+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T16:27:11+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:27:11+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:27:11+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T16:27:11+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:27:11+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T16:27:11+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","time":"2020-08-23T16:27:11+05:30","message":"stopped watching"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T16:27:12+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T16:27:12+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:27:12+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T16:27:12+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T16:27:12+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T16:27:12+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T16:27:12+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:27:13+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:27:13+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T16:27:13+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:27:13+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T16:27:13+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","time":"2020-08-23T16:27:13+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T16:27:15+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:27:15+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T16:27:15+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","time":"2020-08-23T16:27:15+05:30","message":"stopped watching"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T16:27:17+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T16:27:17+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:27:17+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T16:27:18+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:27:18+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T16:27:18+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T16:27:18+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:27:18+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:27:18+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T16:27:19+05:30","message":"pounce success"} +{"level":"debug","time":"2020-08-23T16:27:19+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:27:19+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:27:19+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T16:27:19+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:27:22+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:27:22+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T16:27:22+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:27:22+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T16:27:22+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T16:27:22+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:27:22+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T16:27:22+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T16:27:22+05:30","message":"stopped watching"} +PASS +ok github.com/SystemBuilders/LocKey/internal/lockclient 19.866s +2020/08/23 19:08:37 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:08:37+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:08:37+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:37+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:08:37+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:37+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T19:08:37+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:08:37+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:37+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:08:37+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:37+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:08:37+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:37+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T19:08:37+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T19:08:37+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T19:08:37+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:08:37+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T19:08:37+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:08:37+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T19:08:37+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:08:37+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:38+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:38+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:38+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:08:38+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:08:38+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:08:38+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:08:38+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:40+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:40+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:40+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T19:08:40+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T19:08:40+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:08:40+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:08:40+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:08:40+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:08:40+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:42+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:42+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:08:42+05:30","message":"pounce success"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:08:42+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:08:42+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:08:42+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:08:42+05:30","message":"stopped watching"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T19:08:43+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T19:08:43+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T19:08:43+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T19:08:43+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T19:08:43+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T19:08:44+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T19:08:44+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:08:44+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:08:44+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:08:44+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T19:08:44+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T19:08:44+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:08:46+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:08:46+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:08:46+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:08:46+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T19:08:46+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:08:46+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T19:08:46+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T19:08:48+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T19:08:48+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:08:48+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T19:08:48+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:08:48+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T19:08:49+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:08:49+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:08:49+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:08:49+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:08:49+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:08:49+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:08:49+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:08:49+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:08:49+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","time":"2020-08-23T19:08:50+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:08:52+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:08:52+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:08:52+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:08:52+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T19:08:52+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:08:52+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:08:52+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:08:52+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:08:52+05:30","message":"stopped watching"} +PASS +ok github.com/SystemBuilders/LocKey/internal/lockclient 17.858s +2020/08/23 19:08:56 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:08:56+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:56+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:08:56+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:08:56+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","time":"2020-08-23T19:08:56+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:08:56+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:56+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:08:56+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:56+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:08:56+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:56+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T19:08:56+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T19:08:56+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T19:08:56+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:08:56+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T19:08:56+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:08:56+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T19:08:57+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:08:57+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:57+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:57+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:08:57+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:08:57+05:30","message":"lock is in acquired state"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:08:57+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:08:57+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:08:57+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:08:57+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:59+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:08:59+05:30","message":"lock is in released state"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T19:08:59+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:08:59+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:08:59+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:01+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:01+05:30","message":"lock is in released state"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:09:01+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:09:01+05:30","message":"lock is in acquired state"} +{"level":"debug","owner":"owner2","time":"2020-08-23T19:09:01+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:09:01+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:09:01+05:30","message":"stopped watching"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T19:09:02+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T19:09:02+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T19:09:02+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T19:09:03+05:30","message":"beginning pounce"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T19:09:03+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T19:09:03+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:09:03+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:09:03+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:09:03+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T19:09:03+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:09:03+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T19:09:07+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T19:09:07+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:09:07+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T19:09:07+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:09:07+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T19:09:08+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:09:08+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:09:08+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:09:08+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:09:08+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:09:08+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:09:08+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:09:08+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:09:08+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:09:08+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:09:10+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:09:10+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:09:10+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:09:10+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:09:10+05:30","message":"lock is in acquired state"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:09:10+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:09:10+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:09:10+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:09:10+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +--- FAIL: TestLockService (16.57s) + --- FAIL: TestLockService/pounce_test_without_quitting_in_between,_without_waiting_for_object (5.14s) + simple_client_test.go:335: + Error Trace: simple_client_test.go:335 + Error: Not equal: + expected: []string{"owner1"} + actual : []string{"owner1", "owner3"} + + Diff: + --- Expected + +++ Actual + @@ -1,3 +1,4 @@ + -([]string) (len=1) { + - (string) (len=6) "owner1" + +([]string) (len=2) { + + (string) (len=6) "owner1", + + (string) (len=6) "owner3" + } + Test: TestLockService/pounce_test_without_quitting_in_between,_without_waiting_for_object + simple_client_test.go:327: + Error Trace: simple_client_test.go:327 + asm_amd64.s:1373 + Error: Received unexpected error: + file already acquired + Test: TestLockService/pounce_test_without_quitting_in_between,_without_waiting_for_object + simple_client_test.go:340: + Error Trace: simple_client_test.go:340 + Error: Not equal: + expected: []string{} + actual : []string{"owner3"} + + Diff: + --- Expected + +++ Actual + @@ -1,2 +1,3 @@ + -([]string) { + +([]string) (len=1) { + + (string) (len=6) "owner3" + } + Test: TestLockService/pounce_test_without_quitting_in_between,_without_waiting_for_object +FAIL +exit status 1 +FAIL github.com/SystemBuilders/LocKey/internal/lockclient 16.713s +2020/08/23 19:09:14 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:09:14+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:09:14+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:14+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:09:14+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:14+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T19:09:14+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:09:14+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:14+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:09:14+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:14+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:09:14+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:14+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T19:09:14+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T19:09:14+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T19:09:14+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:09:14+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T19:09:14+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:09:14+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T19:09:14+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:09:14+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:15+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:09:15+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:09:15+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:09:15+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:15+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:09:15+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:17+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:17+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:17+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T19:09:17+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:09:17+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:09:17+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:09:17+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:19+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:19+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:19+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:09:19+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T19:09:19+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:09:19+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:09:19+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:09:19+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:09:19+05:30","message":"stopped watching"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T19:09:20+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T19:09:20+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T19:09:20+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T19:09:20+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T19:09:20+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T19:09:20+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T19:09:20+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:09:21+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:09:21+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T19:09:21+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:09:21+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T19:09:21+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:09:23+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:09:23+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T19:09:23+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T19:09:23+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:09:23+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T19:09:23+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","time":"2020-08-23T19:09:23+05:30","message":"stopped watching"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T19:09:25+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T19:09:25+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:09:25+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T19:09:25+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:09:25+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T19:09:26+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:09:26+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:09:26+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:09:26+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:09:26+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","time":"2020-08-23T19:09:26+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:09:26+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:09:26+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:09:26+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:09:26+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:09:28+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:09:28+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:09:28+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T19:09:28+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:09:28+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:09:28+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:09:28+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:09:28+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:09:28+05:30","message":"lock is in acquired state"} +PASS +ok github.com/SystemBuilders/LocKey/internal/lockclient 17.319s +2020/08/23 19:09:32 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:09:32+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:32+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:09:32+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:32+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:09:32+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:32+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T19:09:32+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:09:32+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:32+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:09:32+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:32+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:09:32+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:32+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T19:09:32+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T19:09:32+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T19:09:32+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:09:32+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T19:09:32+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:09:32+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T19:09:33+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:09:33+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:33+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:33+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:33+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:09:33+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:09:33+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:09:33+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:09:33+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:35+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T19:09:35+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:09:35+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:09:35+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:09:35+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:37+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:37+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:09:37+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:09:37+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:09:37+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","time":"2020-08-23T19:09:37+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:09:37+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:09:37+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T19:09:38+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T19:09:38+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T19:09:38+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T19:09:38+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T19:09:38+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T19:09:39+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T19:09:39+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:09:39+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:09:39+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:09:39+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T19:09:39+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T19:09:39+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:09:41+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:09:42+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:09:42+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T19:09:42+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T19:09:42+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T19:09:42+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:09:42+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T19:09:44+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T19:09:44+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:09:44+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T19:09:44+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:09:44+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T19:09:44+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:09:44+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:09:45+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:09:45+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:09:45+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:09:45+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:09:45+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","time":"2020-08-23T19:09:45+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:09:45+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:09:45+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:09:45+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:09:45+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:09:47+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:09:47+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:09:47+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:09:47+05:30","message":"lock is in acquired state"} +{"level":"debug","owner":"owner3","time":"2020-08-23T19:09:47+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:09:47+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:09:47+05:30","message":"stopped watching"} +PASS +ok github.com/SystemBuilders/LocKey/internal/lockclient 16.984s +2020/08/23 19:09:50 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:09:50+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:50+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:09:50+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:50+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","time":"2020-08-23T19:09:50+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:09:50+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:50+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:09:50+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:50+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:09:50+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:50+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T19:09:50+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T19:09:50+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T19:09:50+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:09:50+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T19:09:50+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:09:50+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T19:09:51+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:09:51+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:51+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:51+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:51+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:09:51+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:09:51+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:09:51+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:09:51+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:09:51+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:09:51+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:54+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:54+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T19:09:54+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:09:54+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:09:54+05:30","message":"lock is in acquired state"} +{"level":"debug","owner":"owner2","time":"2020-08-23T19:09:54+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","time":"2020-08-23T19:09:54+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:09:56+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:09:56+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T19:09:56+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:09:56+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:09:56+05:30","message":"stopped watching"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T19:09:57+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T19:09:57+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T19:09:57+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T19:09:57+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T19:09:57+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T19:09:57+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T19:09:57+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:09:58+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:09:58+05:30","message":"lock is in released state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:09:58+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T19:09:58+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T19:09:58+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:10:00+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:10:00+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T19:10:00+05:30","message":"lock is in acquired state"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:10:00+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T19:10:00+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:10:00+05:30","message":"stopped watching"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T19:10:02+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T19:10:02+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:10:02+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T19:10:02+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:10:02+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T19:10:04+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:10:04+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:10:04+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:10:04+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:10:04+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","time":"2020-08-23T19:10:04+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:10:04+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:10:04+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:10:04+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:10:04+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:10:04+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:10:04+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:10:09+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:10:09+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:10:09+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:10:09+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:10:09+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T19:10:09+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","time":"2020-08-23T19:10:09+05:30","message":"stopped watching"} +--- FAIL: TestLockService (21.99s) + --- FAIL: TestLockService/pounce_test_with_quitting_in_between,_without_waiting_for_object (10.17s) + simple_client_test.go:390: + Error Trace: simple_client_test.go:390 + Error: Not equal: + expected: []string{"owner1", "owner2"} + actual : []string{"owner1", "owner2", "owner3"} + + Diff: + --- Expected + +++ Actual + @@ -1,4 +1,5 @@ + -([]string) (len=2) { + +([]string) (len=3) { + (string) (len=6) "owner1", + - (string) (len=6) "owner2" + + (string) (len=6) "owner2", + + (string) (len=6) "owner3" + } + Test: TestLockService/pounce_test_with_quitting_in_between,_without_waiting_for_object +FAIL +exit status 1 +FAIL github.com/SystemBuilders/LocKey/internal/lockclient 22.126s +2020/08/23 19:10:13 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:10:13+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:13+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:10:13+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:13+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T19:10:13+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:10:13+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:13+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:10:13+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:13+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:10:13+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:13+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T19:10:13+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T19:10:13+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T19:10:13+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:10:13+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T19:10:14+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:10:14+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T19:10:14+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:10:14+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:14+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:14+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:14+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:10:15+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:10:15+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:10:15+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:10:15+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:17+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:17+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:17+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T19:10:17+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T19:10:17+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:10:17+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:10:17+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:10:17+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:10:17+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:19+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:19+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:10:19+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T19:10:19+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:10:19+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:10:19+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:10:19+05:30","message":"stopped watching"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T19:10:20+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T19:10:20+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T19:10:20+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T19:10:20+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T19:10:20+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T19:10:20+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T19:10:20+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:10:21+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:10:21+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:10:21+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:10:21+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T19:10:21+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:10:21+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T19:10:21+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:10:23+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:10:23+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T19:10:23+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T19:10:23+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:10:23+05:30","message":"stopped watching"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T19:10:25+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T19:10:25+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:10:25+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T19:10:25+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:10:25+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T19:10:25+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:10:25+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:10:27+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:10:27+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:10:27+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:10:27+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:10:27+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:10:27+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:10:27+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","time":"2020-08-23T19:10:27+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","time":"2020-08-23T19:10:27+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:10:29+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:10:29+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:10:29+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T19:10:29+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:10:29+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:10:29+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:10:29+05:30","message":"lock is in acquired state"} +PASS +ok github.com/SystemBuilders/LocKey/internal/lockclient 18.119s +2020/08/23 19:10:32 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:10:33+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:33+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:10:33+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:10:33+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:33+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T19:10:33+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:10:33+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:33+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:10:33+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:33+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:10:33+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:33+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T19:10:33+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T19:10:33+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T19:10:33+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:10:33+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T19:10:33+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:10:33+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T19:10:33+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:10:33+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:34+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:34+05:30","message":"lock is in released state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:10:34+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:10:34+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:10:34+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:10:34+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:36+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:36+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:36+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T19:10:36+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:10:36+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:10:36+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:10:36+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:38+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:10:38+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:10:38+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T19:10:38+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:10:38+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:10:38+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:10:38+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:10:38+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T19:10:39+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T19:10:39+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T19:10:39+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T19:10:39+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T19:10:39+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T19:10:40+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T19:10:40+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:10:40+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:10:40+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:10:40+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T19:10:40+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T19:10:40+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:10:42+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:10:42+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:10:42+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:10:42+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T19:10:42+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:10:42+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T19:10:42+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T19:10:44+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T19:10:44+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:10:44+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T19:10:44+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:10:44+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T19:10:45+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:10:45+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:10:47+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:10:47+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:10:47+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:10:47+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:10:47+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:10:47+05:30","message":"stopped watching"} +{"level":"debug","time":"2020-08-23T19:10:47+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:10:47+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:10:47+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:10:50+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:10:50+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:10:50+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T19:10:50+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:10:50+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:10:50+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:10:50+05:30","message":"lock is in acquired state"} +--- FAIL: TestLockService (21.82s) + --- FAIL: TestLockService/pounce_test_without_quitting_in_between,_without_waiting_for_object (5.38s) + simple_client_test.go:335: + Error Trace: simple_client_test.go:335 + Error: Not equal: + expected: []string{"owner1"} + actual : []string{"owner1", "owner3"} + + Diff: + --- Expected + +++ Actual + @@ -1,3 +1,4 @@ + -([]string) (len=1) { + - (string) (len=6) "owner1" + +([]string) (len=2) { + + (string) (len=6) "owner1", + + (string) (len=6) "owner3" + } + Test: TestLockService/pounce_test_without_quitting_in_between,_without_waiting_for_object +FAIL +exit status 1 +FAIL github.com/SystemBuilders/LocKey/internal/lockclient 22.222s +2020/08/23 19:11:13 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:11:13+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:13+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:11:13+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:13+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","time":"2020-08-23T19:11:13+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:11:13+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:13+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:11:13+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:13+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:11:13+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:13+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T19:11:13+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T19:11:13+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T19:11:13+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:11:13+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T19:11:13+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:11:13+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T19:11:14+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:11:14+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:14+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:14+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:14+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:11:14+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:11:14+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:11:14+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:11:14+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:11:14+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:11:14+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:16+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:16+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T19:11:16+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:11:16+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:11:16+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:18+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:18+05:30","message":"lock is in released state"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:11:18+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T19:11:18+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:11:18+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:11:18+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:11:18+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T19:11:19+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T19:11:19+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T19:11:19+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T19:11:19+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T19:11:19+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T19:11:20+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T19:11:20+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:11:21+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:11:21+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T19:11:21+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:11:21+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T19:11:21+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:11:23+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:11:23+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:11:23+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:11:23+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T19:11:23+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:11:23+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T19:11:25+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T19:11:25+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:11:25+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T19:11:26+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:11:26+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T19:11:26+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:11:26+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:11:27+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:11:27+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:11:27+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:11:27+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:11:27+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:11:27+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:11:27+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","time":"2020-08-23T19:11:27+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:11:29+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:11:29+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:11:29+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:11:29+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T19:11:29+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:11:29+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:11:29+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:11:29+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +PASS +ok github.com/SystemBuilders/LocKey/internal/lockclient 18.090s +2020/08/23 19:11:32 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:11:33+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:33+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:11:33+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:33+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:11:33+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:33+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T19:11:33+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:11:33+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:33+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:11:33+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:33+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:11:33+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","time":"2020-08-23T19:11:33+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T19:11:33+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T19:11:33+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:11:33+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T19:11:33+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:11:33+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T19:11:33+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:11:33+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:34+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:34+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:34+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:11:34+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:11:34+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:11:34+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:11:34+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:11:34+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:11:34+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:36+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:36+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T19:11:36+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:11:36+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:11:36+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:38+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:38+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:11:38+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T19:11:38+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:11:38+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:11:38+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:11:38+05:30","message":"stopped watching"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T19:11:39+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T19:11:39+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T19:11:39+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T19:11:40+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T19:11:40+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T19:11:40+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T19:11:40+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:11:40+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:11:40+05:30","message":"lock is in released state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:11:40+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:11:40+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T19:11:40+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:11:40+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T19:11:40+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:11:42+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner3","time":"2020-08-23T19:11:42+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:11:42+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T19:11:42+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","time":"2020-08-23T19:11:42+05:30","message":"stopped watching"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T19:11:44+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T19:11:44+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:11:44+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T19:11:44+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:11:44+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T19:11:46+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:11:46+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:11:46+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:11:46+05:30","message":"pounce success"} +{"level":"debug","time":"2020-08-23T19:11:46+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:11:46+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:11:46+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:11:46+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:11:48+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:11:48+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:11:48+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:11:48+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T19:11:48+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:11:48+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:11:48+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:11:48+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:11:48+05:30","message":"stopped watching"} +--- FAIL: TestLockService (17.70s) + --- FAIL: TestLockService/pounce_test_with_quitting_in_between,_without_waiting_for_object (6.26s) + simple_client_test.go:390: + Error Trace: simple_client_test.go:390 + Error: Not equal: + expected: []string{"owner1", "owner2"} + actual : []string{"owner1", "owner2", "owner3"} + + Diff: + --- Expected + +++ Actual + @@ -1,4 +1,5 @@ + -([]string) (len=2) { + +([]string) (len=3) { + (string) (len=6) "owner1", + - (string) (len=6) "owner2" + + (string) (len=6) "owner2", + + (string) (len=6) "owner3" + } + Test: TestLockService/pounce_test_with_quitting_in_between,_without_waiting_for_object +FAIL +exit status 1 +FAIL github.com/SystemBuilders/LocKey/internal/lockclient 17.795s +2020/08/23 19:11:51 Starting Server on 127.0.0.1:1234 +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't acquire, already been acquired"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"can't release, unauthorized access"} +{"level":"debug","descriptor":"test2","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:11:51+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:11:51+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","descriptor":"test","message":"checkacquire success"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:11:51+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","message":"check acquire failure"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:51+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T19:11:51+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:11:51+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:51+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:11:51+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:51+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:11:51+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:51+05:30","message":"lock is in released state"} +{"level":"debug","time":"2020-08-23T19:11:51+05:30","message":"stopped watching"} +{"level":"debug","object":"test","pouncer":"owner","time":"2020-08-23T19:11:51+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test","owner":"owner","message":"locked"} +{"level":"debug","object":"test","pouncer":"owner1","time":"2020-08-23T19:11:51+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:11:51+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner2","time":"2020-08-23T19:11:51+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:11:51+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test","pouncer":"owner3","time":"2020-08-23T19:11:52+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner","time":"2020-08-23T19:11:52+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:52+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:52+05:30","message":"lock is in released state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:11:52+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:11:52+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:11:52+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner1","time":"2020-08-23T19:11:52+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:55+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:55+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner2","time":"2020-08-23T19:11:55+05:30","message":"pounce success"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:11:55+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:11:55+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner2","time":"2020-08-23T19:11:55+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test","owner":"owner2","message":"released"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:57+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test","time":"2020-08-23T19:11:57+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:11:57+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:11:57+05:30","message":"pounce success"} +{"level":"debug","owner":"owner2","time":"2020-08-23T19:11:57+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","time":"2020-08-23T19:11:57+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:11:57+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"test","owner":"owner3","time":"2020-08-23T19:11:57+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner","time":"2020-08-23T19:11:58+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"locked"} +{"level":"debug","object":"test1","pouncer":"owner1","time":"2020-08-23T19:11:58+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T19:11:58+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"test1","pouncer":"owner2","time":"2020-08-23T19:11:58+05:30","message":"beginning pounce"} +{"level":"debug","time":"2020-08-23T19:11:58+05:30","message":"stopped pounce activity, object already under pounce"} +{"level":"debug","object":"test1","pouncer":"owner3","time":"2020-08-23T19:11:58+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner","time":"2020-08-23T19:11:58+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"test1","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:11:59+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"locked"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:11:59+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T19:11:59+05:30","message":"lock is in acquired state"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:11:59+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:11:59+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"test1","owner":"owner1","time":"2020-08-23T19:11:59+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:11:59+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"test1","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"test1","time":"2020-08-23T19:12:02+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"test1","owner":"owner3","message":"locked"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:12:02+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T19:12:02+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","time":"2020-08-23T19:12:02+05:30","message":"stopped watching"} +{"level":"debug","object":"testx","pouncer":"owner","time":"2020-08-23T19:12:04+05:30","message":"beginning pounce"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"locked"} +{"level":"debug","object":"testx","pouncer":"owner1","time":"2020-08-23T19:12:04+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:12:04+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner2","time":"2020-08-23T19:12:04+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:12:04+05:30","message":"lock is in acquired state"} +{"level":"debug","object":"testx","pouncer":"owner3","time":"2020-08-23T19:12:04+05:30","message":"beginning pounce"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner","time":"2020-08-23T19:12:04+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","owner":"owner","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:12:05+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:12:05+05:30","message":"lock is in released state"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:12:05+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"locked"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","lock granted through pounce to":"owner1","time":"2020-08-23T19:12:05+05:30","message":"pounce success"} +{"level":"debug","owner":"owner1","time":"2020-08-23T19:12:05+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:12:05+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:12:05+05:30","message":"stopped watching"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner1","time":"2020-08-23T19:12:05+05:30","message":"lock is in acquired state"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +{"level":"debug","time":"2020-08-23T19:12:05+05:30","message":"stop signal received, stopped pouncing process"} +{"level":"debug","descriptor":"testx","owner":"owner1","message":"released"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:12:09+05:30","message":"lock is in released state"} +{"level":"debug","descriptor":"testx","owner":"owner3","message":"locked"} +{"level":"debug","process":"lock watching","lock":"testx","time":"2020-08-23T19:12:09+05:30","message":"lock is in released state"} +{"level":"debug","lock granted through pounce to":"owner3","time":"2020-08-23T19:12:09+05:30","message":"pounce success"} +{"level":"debug","owner":"owner3","time":"2020-08-23T19:12:09+05:30","message":"stopping pouncing process, pouncer availed lock"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:12:09+05:30","message":"lock is in acquired state"} +{"level":"debug","process":"lock watching","lock":"testx","owner":"owner3","time":"2020-08-23T19:12:09+05:30","message":"lock is in acquired state"} +{"level":"debug","time":"2020-08-23T19:12:09+05:30","message":"stopped watching"} +{"level":"debug","descriptor":"testx","message":"can't acquire, already been acquired"} +PASS +ok github.com/SystemBuilders/LocKey/internal/lockclient 22.351s diff --git a/internal/lockclient/simple_client.go b/internal/lockclient/simple_client.go index 6013bfb..77e614b 100644 --- a/internal/lockclient/simple_client.go +++ b/internal/lockclient/simple_client.go @@ -7,44 +7,64 @@ import ( "io/ioutil" "net/http" "strings" + "sync" "github.com/SystemBuilders/LocKey/internal/cache" "github.com/SystemBuilders/LocKey/internal/lockservice" + "github.com/rs/zerolog/log" ) var _ Config = (*lockservice.SimpleConfig)(nil) // SimpleClient implements Client, the lockclient for LocKey. type SimpleClient struct { - config lockservice.SimpleConfig - cache cache.LRUCache + config *lockservice.SimpleConfig + cache *cache.LRUCache + pouncersMap map[lockservice.ObjectDescriptor][]string + mu sync.Mutex } -// NewSimpleKey returns a new SimpleKey of the given value. -func NewSimpleClient(config lockservice.SimpleConfig, cache cache.LRUCache) *SimpleClient { +// NewSimpleClient returns a new SimpleKey of the given value. +// This client works with or without the existance of a cache. +func NewSimpleClient(config *lockservice.SimpleConfig, cache *cache.LRUCache) *SimpleClient { + p := make(map[lockservice.ObjectDescriptor][]string) return &SimpleClient{ - config: config, - cache: cache, + config: config, + cache: cache, + pouncersMap: p, } } var _ Client = (*SimpleClient)(nil) -// Acquire makes a HTTP call to the lockserver and acquires the lock. -// The errors invloved may be due the HTTP errors or the lockservice errors. +// Acquire internally calls Pounce in order to follow the FIFO order. +// Acquire assumes that the process will wait for the lock until it's released. func (sc *SimpleClient) Acquire(d lockservice.Descriptors) error { - endPoint := sc.config.IP() + ":" + sc.config.Port() + "/acquire" - - isInCache := sc.cache.GetElement(cache.NewSimpleKey(d.ID())) + return sc.pounce(lockservice.ObjectDescriptor{ObjectID: d.ID()}, d.Owner(), nil, true) +} - if isInCache == nil { - return lockservice.ErrFileAcquired +// acquire makes an HTTP call to the lockserver and acquires the lock. +// The errors involved may be due the HTTP errors or the lockservice errors. +// +// acquire can ONLY be called by Pouncer when it's sure that this was the +// process next in line to acquire the lock. +func (sc *SimpleClient) acquire(d lockservice.Descriptors) error { + // Check for existance of a cache and check + // if the element is in the cache. + if sc.cache != nil { + _, err := sc.getFromCache(lockservice.ObjectDescriptor{ObjectID: d.ID()}) + // Since there can be network errors, we have this double check. + if err != nil && err != lockservice.ErrCheckacquireFailure { + return err + } } + endPoint := sc.config.IP() + ":" + sc.config.Port() + "/acquire" + // Since the cache doesn't have the element, query the server. testData := lockservice.LockRequest{FileID: d.ID(), UserID: d.Owner()} - requestJson, err := json.Marshal(testData) + requestJSON, err := json.Marshal(testData) - req, err := http.NewRequest("POST", endPoint, bytes.NewBuffer(requestJson)) + req, err := http.NewRequest("POST", endPoint, bytes.NewBuffer(requestJSON)) if err != nil { return err } @@ -54,47 +74,61 @@ func (sc *SimpleClient) Acquire(d lockservice.Descriptors) error { resp, err := client.Do(req) if err != nil { - return (err) + return err } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) - if resp.StatusCode != 200 { return errors.New(strings.TrimSpace(string(body))) } - err = sc.cache.PutElement(cache.NewSimpleKey(d.ID())) - if err != nil { - return err - } + if sc.cache != nil { + err := sc.addToCache(d) + if err != nil { + return err + } + } return nil } -// Release makes a HTTP call to the lockserver and acquires the lock. +// Release makes an HTTP call to the lockserver and acquires the lock. // The errors invloved may be due the HTTP errors or the lockservice errors. func (sc *SimpleClient) Release(d lockservice.Descriptors) error { endPoint := sc.config.IPAddr + ":" + sc.config.PortAddr + "/release" + data := lockservice.LockRequest{FileID: d.ID(), UserID: d.Owner()} + requestJSON, err := json.Marshal(data) + if err != nil { + return err + } - testData := lockservice.LockRequest{FileID: d.ID(), UserID: d.Owner()} - requestJson, err := json.Marshal(testData) - req, err := http.NewRequest("POST", endPoint, bytes.NewBuffer(requestJson)) + req, err := http.NewRequest("POST", endPoint, bytes.NewBuffer(requestJSON)) + if err != nil { + return err + } req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) - if err != nil { return (err) } defer resp.Body.Close() - body, _ := ioutil.ReadAll(resp.Body) - + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return err + } if resp.StatusCode != 200 { return lockservice.Error(strings.TrimSpace(string(body))) } - sc.cache.RemoveElement(cache.NewSimpleKey(d.ID())) + + if sc.cache != nil { + err = sc.releaseFromCache(d) + if err != nil { + return err + } + } return nil } @@ -103,3 +137,331 @@ func (sc *SimpleClient) Release(d lockservice.Descriptors) error { func (sc *SimpleClient) StartService(cfg Config) error { panic("TODO") } + +// Watch can be used to watch the given lock descriptor. +// This works with or without the existance of a cache +// for the client. +// +// On calling Watch, the current state of the lock is +// returned. +// If the lock is acquired by a different process, the +// details of the acquirer is sent back and the function +// doesn't return unless explicitly told to. Only on changes +// in the ownership of the lock, details are sent back to +// the function caller. +// +// The function also returns if THIS owner eventually pounced +// and got access to the lock. +// +// The stateChan is assumed to be cleared as soon as data is +// sent through it. +// +// Usage: +// quitChan := make(chan struct{},1) +// stateChan, err := client.Watch(descriptor,quitChan) +// go func() { +// for { +// state := <-stateChan +// // process the state data. +// } +// } +// +func (sc *SimpleClient) watch(d lockservice.ObjectDescriptor, quit chan struct{}) (chan Lock, error) { + stateChan := make(chan Lock, 1) + // releaseNotification is true if the last notification wasn't a release. + releaseNotification := false + owner, err := sc.Checkacquire(d) + if err != nil { + if err != lockservice.ErrCheckacquireFailure { + return nil, err + } + // This means that the file is released + if releaseNotification { + releaseNotification = false + stateChan <- Lock{"", Release} + log.Debug(). + Str("process", "lock watching"). + Str("lock", d.ObjectID). + Msg("lock is in released state") + } + } + // Send the initial state of the lock and then + // keep sending state changes until stopped + // explicitly. + if owner != "" { + releaseNotification = true + stateChan <- Lock{owner, acquire} + log.Debug(). + Str("process", "lock watching"). + Str("lock", d.ObjectID). + Str("owner", owner). + Msg("lock is in acquired state") + } + + go func() { + for { + select { + case <-quit: + close(stateChan) + log.Debug().Msg("stopped watching") + return + default: + newOwner, err := sc.Checkacquire(d) + if err != nil { + if err != lockservice.ErrCheckacquireFailure { + return + } + if releaseNotification { + releaseNotification = false + stateChan <- Lock{"", Release} + log.Debug(). + Str("process", "lock watching"). + Str("lock", d.ObjectID). + Msg("lock is in released state") + } + } else { + // notify about the state only if there's a change. + if newOwner != owner { + releaseNotification = true + owner = newOwner + stateChan <- Lock{owner, acquire} + log.Debug(). + Str("process", "lock watching"). + Str("lock", d.ObjectID). + Str("owner", owner). + Msg("lock is in acquired state") + } + } + } + } + }() + return stateChan, nil +} + +// Pounce can be used to acquire a lock that has already been acquired. +// It allows the process to wait for the lock in a queue and obtain it +// in FCFS order. +// +// One lock can have many pouncers. The "pouncer" can choose to +// wait on the object until it gets the lock or return if there was +// a preceding "pouncer" for the lock. +// +// The "pouncer" can stop "pouncing" at any time by signalling through +// the channel passed as the argument. +// +// The boolean argument dictates the function to pounce or not +// when there is an existng "pouncer", "true" for pounce even with "pouncers". +// +// The pounce returns on achieving its goal of acquiring the lock or when +// there are no more pouncers to be served. +// +// Pounce usage: +// go func() { +// err := sc.Pounce(objectDesc,owner,quitChan,instantPounce) +// // errcheck +// } +// Pounce must be used inside a goroutine as it's a blocking process. +// Handling of ErrObjectHasBeenPouncedOn is necesssary. +func (sc *SimpleClient) pounce(d lockservice.ObjectDescriptor, owner string, quit chan struct{}, instant bool) error { + + log.Debug(). + Str("object", d.ObjectID). + Str("pouncer", owner). + Msg("beginning pounce") + + // Reject the pounce if the client doesn't want to pounce on + // pre-pounced objects. + if !instant && (len(sc.pouncers(d)) > 0) { + log.Debug().Msg("stopped pounce activity, object already under pounce") + return ErrorObjectAlreadyPouncedOn + } + + // If the lock is already acquired, the pouncee is added to the waiting list of + // pouncers, else, the process gets access to the lock immidiately. + _, err := sc.Checkacquire(d) + if err == nil { + sc.mu.Lock() + sc.pouncersMap[d] = append(sc.pouncersMap[d], owner) + sc.mu.Unlock() + } else { + return sc.acquire(&lockservice.LockDescriptor{FileID: d.ObjectID, UserID: owner}) + } + + // Here we start waiting for the quit signal in order to + // end on command or wait on the lock state to grant access + // to the pouncer. + // The lock is continously watched and whenever the lock is + // released the first pouncer obtains the lock. + q := make(chan struct{}) + stateChan, err := sc.watch(d, q) + if err != nil { + return err + } + for { + select { + case <-quit: + // This owner will be added to the pouncer's queue, + // it must be removed + sc.removeOwner(d, owner) + log.Debug().Msg("stop signal received, stopped pouncing process") + default: + state := <-stateChan + // When there's a release operation that occurred, a + // new client process can get access to the lock. + // Always the first element in the slice is granted access + // to the lock on the object. + if state.LockState == Release { + var op string + pouncers := sc.pouncers(d) + if len(pouncers) > 0 { + op = pouncers[0] + } + + // Errors arising here aren't propagated because this + // process doesn't care about it. + curOwner, err := sc.Checkacquire(d) + if curOwner == "" && err != nil { + desc := lockservice.NewLockDescriptor(d.ObjectID, op) + err = sc.acquire(desc) + if err == nil { + sc.mu.Lock() + // Once the task of acquiring is complete, remove + // the first element from the slice as it was granted the lock. + sc.pouncersMap[d] = append(sc.pouncersMap[d][:0], sc.pouncersMap[d][1:]...) + sc.mu.Unlock() + + log.Debug(). + Str("lock granted through pounce to", op). + Msg("pounce success") + + // Exit condition is the pouncer getting access to the lock. + if op == owner || len(sc.pouncers(d)) == 0 { + log.Debug(). + Str("owner", owner). + Msg("stopping pouncing process, pouncer availed lock") + q <- struct{}{} + close(q) + return nil + } + } + } + + } + } + } +} + +// Pouncers returns the active "pouncers" on a descriptor. +// This is safe to read concurrently. +func (sc *SimpleClient) pouncers(d lockservice.ObjectDescriptor) []string { + sc.mu.Lock() + var x = make([]string, len(sc.pouncersMap[d])) + copy(x, sc.pouncersMap[d]) + sc.mu.Unlock() + // fmt.Println(x) + // fmt.Println(sc.pouncers[d]) + return x +} + +// Checkacquire checks for acquisition of lock and returns the owner if the lock +// is already acquired. +// The errors returned can be due to HTTP errors or marshalling errors. +// A "file is not acquired" error is returned if so and no error and an owner is +// returned if the object is acquired. +func (sc *SimpleClient) Checkacquire(d lockservice.ObjectDescriptor) (string, error) { + if sc.cache != nil { + owner, err := sc.getFromCache(d) + if err != nil { + return "", err + } + return owner, nil + } + + endPoint := sc.config.IPAddr + ":" + sc.config.PortAddr + "/checkacquire" + data := lockservice.LockCheckRequest{FileID: d.ObjectID} + requestJSON, err := json.Marshal(data) + if err != nil { + return "", err + } + + req, err := http.NewRequest("POST", endPoint, bytes.NewBuffer(requestJSON)) + if err != nil { + return "", err + } + + req.Header.Set("Content-Type", "application/json") + + client := &http.Client{} + resp, err := client.Do(req) + if err != nil { + return "", err + } + defer resp.Body.Close() + + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return "", err + } + if resp.StatusCode != 200 { + return "", lockservice.Error(strings.TrimSpace(string(body))) + } + + var ownerData lockservice.CheckacquireRes + err = json.Unmarshal(body, &ownerData) + if err != nil { + return "", err + } + + return ownerData.Owner, nil +} + +// getFromCache checks the lock status on the descriptor in the cache. +// This function returns an error if the cache doesn't exist or the +// file is NOT acquired. +func (sc *SimpleClient) getFromCache(d lockservice.ObjectDescriptor) (string, error) { + if sc.cache != nil { + owner, err := sc.cache.GetElement(cache.NewSimpleKey(d.ObjectID, "")) + if err != nil { + return "", lockservice.ErrCheckacquireFailure + } + return owner, nil + } + return "", cache.ErrCacheDoesntExist +} + +func (sc *SimpleClient) addToCache(d lockservice.Descriptors) error { + if sc.cache != nil { + err := sc.cache.PutElement(cache.NewSimpleKey(d.ID(), d.Owner())) + if err != nil { + return err + } + return nil + } + return cache.ErrCacheDoesntExist +} + +func (sc *SimpleClient) releaseFromCache(d lockservice.Descriptors) error { + if sc.cache != nil { + err := sc.cache.RemoveElement(cache.NewSimpleKey(d.ID(), d.Owner())) + if err != nil { + return err + } + return nil + } + return cache.ErrCacheDoesntExist +} + +func (sc *SimpleClient) removeOwner(d lockservice.ObjectDescriptor, owner string) { + index := -1 + sc.mu.Lock() + for i := 0; i < len(sc.pouncersMap[d]); i++ { + if sc.pouncersMap[d][i] == owner { + index = i + break + } + } + if index != -1 { + sc.pouncersMap[d] = append(sc.pouncersMap[d][:index], sc.pouncersMap[d][index+1:]...) + } + sc.mu.Unlock() +} diff --git a/internal/lockclient/simple_client_test.go b/internal/lockclient/simple_client_test.go index 4650ae9..750c846 100644 --- a/internal/lockclient/simple_client_test.go +++ b/internal/lockclient/simple_client_test.go @@ -8,11 +8,12 @@ import ( "github.com/SystemBuilders/LocKey/internal/cache" "github.com/SystemBuilders/LocKey/internal/lockservice" "github.com/SystemBuilders/LocKey/internal/node" + "github.com/stretchr/testify/assert" "github.com/rs/zerolog" ) -func TestAcquireandRelease(t *testing.T) { +func TestLockService(t *testing.T) { zerolog.New(os.Stdout).With() log := zerolog.New(os.Stdout).With().Logger().Level(zerolog.GlobalLevel()) @@ -36,24 +37,24 @@ func TestAcquireandRelease(t *testing.T) { t.Run("acquire test release test", func(t *testing.T) { size := 5 cache := cache.NewLRUCache(size) - sc := NewSimpleClient(*scfg, *cache) + sc := NewSimpleClient(scfg, cache) - d := lockservice.NewSimpleDescriptor("test", "owner") + d := lockservice.NewLockDescriptor("test", "owner") - got := sc.Acquire(d) + got := sc.acquire(d) var want error if got != want { t.Errorf("acquire: got %q want %q", got, want) } - d = lockservice.NewSimpleDescriptor("test1", "owner") + d = lockservice.NewLockDescriptor("test1", "owner") - got = sc.Acquire(d) + got = sc.acquire(d) if got != want { t.Errorf("acquire: got %q want %q", got, want) } - d = lockservice.NewSimpleDescriptor("test", "owner") + d = lockservice.NewLockDescriptor("test", "owner") got = sc.Release(d) @@ -61,7 +62,7 @@ func TestAcquireandRelease(t *testing.T) { t.Errorf("release: got %q want %q", got, want) } - d = lockservice.NewSimpleDescriptor("test1", "owner") + d = lockservice.NewLockDescriptor("test1", "owner") got = sc.Release(d) @@ -73,23 +74,23 @@ func TestAcquireandRelease(t *testing.T) { t.Run("acquire test, acquire test, release test", func(t *testing.T) { size := 5 cache := cache.NewLRUCache(size) - sc := NewSimpleClient(*scfg, *cache) + sc := NewSimpleClient(scfg, cache) - d := lockservice.NewSimpleDescriptor("test", "owner") + d := lockservice.NewLockDescriptor("test", "owner") - got := sc.Acquire(d) + got := sc.acquire(d) var want error if got != want { t.Errorf("acquire: got %q want %q", got, want) } - got = sc.Acquire(d) - want = lockservice.ErrFileAcquired + got = sc.acquire(d) + want = lockservice.ErrFileacquired if got.Error() != want.Error() { t.Errorf("acquire: got %q want %q", got, want) } - d = lockservice.NewSimpleDescriptor("test", "owner") + d = lockservice.NewLockDescriptor("test", "owner") got = sc.Release(d) want = nil @@ -99,40 +100,387 @@ func TestAcquireandRelease(t *testing.T) { }) t.Run("acquire test, trying to release test as another entity should fail", func(t *testing.T) { - size := 1 + size := 2 cache := cache.NewLRUCache(size) - sc := NewSimpleClient(*scfg, *cache) + sc := NewSimpleClient(scfg, cache) - d := lockservice.NewSimpleDescriptor("test", "owner1") - got := sc.Acquire(d) + d := lockservice.NewLockDescriptor("test", "owner1") + got := sc.acquire(d) var want error if got != want { t.Errorf("acquire: got %q want %q", got, want) } - d = lockservice.NewSimpleDescriptor("test", "owner2") + d = lockservice.NewLockDescriptor("test", "owner2") got = sc.Release(d) want = lockservice.ErrUnauthorizedAccess if got != want { t.Errorf("acquire: got %v want %v", got, want) } - d = lockservice.NewSimpleDescriptor("test2", "owner1") - got = sc.Acquire(d) + d = lockservice.NewLockDescriptor("test2", "owner1") + got = sc.acquire(d) want = nil if got != want { t.Errorf("acquire: got %q want %q", got, want) } - d = lockservice.NewSimpleDescriptor("test", "owner1") - + d = lockservice.NewLockDescriptor("test", "owner1") got = sc.Release(d) want = nil - if got != want { t.Errorf("release: got %q want %q", got, want) } }) + + t.Run("lock watching without cache", func(t *testing.T) { + sc := NewSimpleClient(scfg, nil) + + assert := assert.New(t) + d := lockservice.NewLockDescriptor("test", "owner1") + // acquire the lock + err := sc.acquire(d) + assert.Nil(err) + + // start watching the lock. + quit := make(chan struct{}, 1) + stateChan, err := sc.watch(lockservice.ObjectDescriptor{ObjectID: d.ID()}, quit) + assert.Nil(err) + + states := []Lock{} + go func() { + for { + state := <-stateChan + states = append(states, state) + } + }() + + err = sc.Release(d) + assert.Nil(err) + + d1 := lockservice.NewLockDescriptor("test", "owner2") + err = sc.acquire(d1) + assert.Nil(err) + + err = sc.Release(d1) + assert.Nil(err) + + d2 := lockservice.NewLockDescriptor("test", "owner3") + err = sc.acquire(d2) + assert.Nil(err) + + err = sc.Release(d2) + assert.Nil(err) + + quit <- struct{}{} + + // wait to stop watching gracefully. + <-time.After(10 * time.Millisecond) + }) + + t.Run("lock watching with cache", func(t *testing.T) { + size := 5 + cache := cache.NewLRUCache(size) + sc := NewSimpleClient(scfg, cache) + + assert := assert.New(t) + d := lockservice.NewLockDescriptor("test", "owner1") + // acquire the lock + err := sc.acquire(d) + assert.Nil(err) + + // start watching the lock. + quit := make(chan struct{}, 1) + stateChan, err := sc.watch(lockservice.ObjectDescriptor{ObjectID: d.ID()}, quit) + assert.Nil(err) + + states := []Lock{} + go func() { + for { + state := <-stateChan + states = append(states, state) + } + }() + + err = sc.Release(d) + assert.Nil(err) + + d1 := lockservice.NewLockDescriptor("test", "owner2") + err = sc.acquire(d1) + assert.Nil(err) + + err = sc.Release(d1) + assert.Nil(err) + + d2 := lockservice.NewLockDescriptor("test", "owner3") + err = sc.acquire(d2) + assert.Nil(err) + + err = sc.Release(d2) + assert.Nil(err) + + quit <- struct{}{} + + // wait to stop watching gracefully. + <-time.After(10 * time.Millisecond) + }) + + // This test first makes a process acquire a lock. + // Later, pounces using 3 different owners on the same object, + // and then release one by one and observe the behaviour and + // assert the expected behaviour. + // Time waits are added in order to maintain the sequence of + // pounces and have a deterministic test. + // t.Run("pounce test without quitting in between, always wait for object", func(t *testing.T) { + // size := 5 + // cache := cache.NewLRUCache(size) + // sc := NewSimpleClient(scfg, cache) + + // assert := assert.New(t) + // d := lockservice.NewLockDescriptor("test", "owner") + // err := sc.Acquire(d) + // assert.NoError(err) + + // objD := lockservice.NewObjectDescriptor("test") + + // go func() { + // err := sc.Pounce(*objD, "owner1", nil, true) + // assert.NoError(err) + // }() + + // <-time.After(100 * time.Millisecond) + // go func() { + // err := sc.Pounce(*objD, "owner2", nil, true) + // assert.NoError(err) + // }() + + // <-time.After(500 * time.Millisecond) + // go func() { + // err := sc.Pounce(*objD, "owner3", nil, true) + // assert.NoError(err) + // }() + + // pouncersBeforeFirstRelease := []string{"owner1", "owner2", "owner3"} + // pouncersAfterFirstRelease := []string{"owner2", "owner3"} + // pouncersAfterSecondRelease := []string{"owner3"} + // pouncersAfterThirdRelease := []string{} + + // <-time.After(1 * time.Second) + // assert.Equal(sc.Pouncers(*objD), pouncersBeforeFirstRelease) + + // err = sc.Release(d) + // assert.NoError(err) + // <-time.After(1 * time.Second) + // assert.Equal(sc.Pouncers(*objD), pouncersAfterFirstRelease) + + // <-time.After(1 * time.Second) + // owner, err := sc.Checkacquire(*objD) + // if owner == "owner1" { + // err = sc.Release(&lockservice.LockDescriptor{FileID: objD.ObjectID, UserID: "owner1"}) + // assert.NoError(err) + // } + + // <-time.After(1 * time.Second) + // assert.Equal(sc.Pouncers(*objD), pouncersAfterSecondRelease) + + // <-time.After(1 * time.Second) + // owner, err = sc.Checkacquire(*objD) + // if owner == "owner2" { + // err = sc.Release(&lockservice.LockDescriptor{FileID: objD.ObjectID, UserID: "owner2"}) + // assert.NoError(err) + // } + + // <-time.After(1 * time.Second) + // assert.Equal(sc.Pouncers(*objD), pouncersAfterThirdRelease) + // }) + + // // This test is very similar to the one above but owner2 doensn't wait for its pounce. + // t.Run("pounce test without quitting in between, without waiting for object", func(t *testing.T) { + // size := 5 + // cache := cache.NewLRUCache(size) + // sc := NewSimpleClient(scfg, cache) + + // assert := assert.New(t) + // d := lockservice.NewLockDescriptor("test1", "owner") + // err := sc.Acquire(d) + // assert.NoError(err) + + // objD := lockservice.NewObjectDescriptor("test1") + + // go func() { + // err := sc.Pounce(*objD, "owner1", nil, true) + // assert.NoError(err) + // }() + + // <-time.After(100 * time.Millisecond) + // go func() { + // err := sc.Pounce(*objD, "owner2", nil, false) + // if err != ErrorObjectAlreadyPouncedOn { + // assert.NoError(err) + // } + // }() + + // <-time.After(500 * time.Millisecond) + // go func() { + // err := sc.Pounce(*objD, "owner3", nil, true) + // assert.NoError(err) + // }() + + // pouncersBeforeFirstRelease := []string{"owner1", "owner3"} + // pouncersAfterFirstRelease := []string{"owner3"} + // pouncersAfterSecondRelease := []string{} + + // <-time.After(1 * time.Second) + // assert.Equal(sc.Pouncers(*objD), pouncersBeforeFirstRelease) + + // err = sc.Release(d) + // assert.NoError(err) + // <-time.After(1 * time.Second) + // assert.Equal(sc.Pouncers(*objD), pouncersAfterFirstRelease) + + // <-time.After(1 * time.Second) + // owner, err := sc.Checkacquire(*objD) + // if owner == "owner1" { + // err = sc.Release(&lockservice.LockDescriptor{FileID: objD.ObjectID, UserID: "owner1"}) + // assert.NoError(err) + // } + + // <-time.After(2 * time.Second) + // assert.Equal(sc.Pouncers(*objD), pouncersAfterSecondRelease) + // }) + + // // This test is very similar to the one above but a quit signal is sent to owner2's pounce. + // t.Run("pounce test with quitting in between, without waiting for object", func(t *testing.T) { + // size := 5 + // cache := cache.NewLRUCache(size) + // sc := NewSimpleClient(scfg, cache) + + // assert := assert.New(t) + // d := lockservice.NewLockDescriptor("testx", "owner") + + // quitChan := make(chan struct{}, 1) + // err := sc.Acquire(d) + // assert.NoError(err) + + // objD := lockservice.NewObjectDescriptor("testx") + + // go func() { + // err := sc.Pounce(*objD, "owner1", nil, true) + // assert.NoError(err) + // }() + + // <-time.After(100 * time.Millisecond) + // go func() { + // err := sc.Pounce(*objD, "owner2", quitChan, true) + // assert.NoError(err) + // }() + + // <-time.After(500 * time.Millisecond) + // go func() { + // err := sc.Pounce(*objD, "owner3", nil, true) + // assert.NoError(err) + // }() + + // pouncersBeforeFirstRelease := []string{"owner1", "owner2", "owner3"} + // pouncersAfterFirstRelease := []string{"owner3"} + // pouncersAfterSecondRelease := []string{} + + // <-time.After(1 * time.Second) + // assert.Equal(sc.Pouncers(*objD), pouncersBeforeFirstRelease) + + // quitChan <- struct{}{} + // err = sc.Release(d) + // assert.NoError(err) + // <-time.After(1 * time.Second) + // assert.Equal(sc.Pouncers(*objD), pouncersAfterFirstRelease) + + // <-time.After(1 * time.Second) + // owner, err := sc.Checkacquire(*objD) + // if owner == "owner1" { + // err = sc.Release(&lockservice.LockDescriptor{FileID: objD.ObjectID, UserID: "owner1"}) + // assert.NoError(err) + // } + + // <-time.After(2 * time.Second) + // assert.Equal(sc.Pouncers(*objD), pouncersAfterSecondRelease) + // }) + quit <- true return } + +// BenchmarkLocKeyWithoutCache stats: 2130 28828088 ns/op 15952 B/op 190 allocs/op +func BenchmarkLocKeyWithoutCache(b *testing.B) { + zerolog.New(os.Stdout).With() + + log := zerolog.New(os.Stdout).With().Logger().Level(zerolog.GlobalLevel()) + scfg := lockservice.NewSimpleConfig("http://127.0.0.1", "1234") + ls := lockservice.NewSimpleLockService(log) + + quit := make(chan bool, 1) + go func() { + node.Start(ls, *scfg) + for { + select { + case <-quit: + return + default: + } + } + }() + time.Sleep(100 * time.Millisecond) + + sc := NewSimpleClient(scfg, nil) + d := lockservice.NewLockDescriptor("test", "owner") + for n := 0; n < b.N; n++ { + got := sc.acquire(d) + var want error + if got != want { + b.Errorf("acquire: got %q want %q", got, want) + } + + got = sc.Release(d) + if got != want { + b.Errorf("release: got %q want %q", got, want) + } + } +} + +// BenchmarkLocKeyWithCache stats: 3669 28702266 ns/op 16048 B/op 194 allocs/op +func BenchmarkLocKeyWithCache(b *testing.B) { + zerolog.New(os.Stdout).With() + + log := zerolog.New(os.Stdout).With().Logger().Level(zerolog.GlobalLevel()) + scfg := lockservice.NewSimpleConfig("http://127.0.0.1", "1234") + ls := lockservice.NewSimpleLockService(log) + + quit := make(chan bool, 1) + go func() { + node.Start(ls, *scfg) + for { + select { + case <-quit: + return + default: + } + } + }() + time.Sleep(100 * time.Millisecond) + + size := 5 + cache := cache.NewLRUCache(size) + sc := NewSimpleClient(scfg, cache) + d := lockservice.NewLockDescriptor("test", "owner") + for n := 0; n < b.N; n++ { + got := sc.acquire(d) + var want error + if got != want { + b.Errorf("acquire: got %q want %q", got, want) + } + + got = sc.Release(d) + if got != want { + b.Errorf("release: got %q want %q", got, want) + } + } +} diff --git a/internal/lockservice/errors.go b/internal/lockservice/errors.go index cc18cfd..16d2422 100644 --- a/internal/lockservice/errors.go +++ b/internal/lockservice/errors.go @@ -8,7 +8,9 @@ func (e Error) Error() string { return string(e) } // Constant errors. // Rule of thumb, all errors start with a small letter and end with no full stop. const ( - ErrFileAcquired = Error("file already acquired") - ErrCantReleaseFile = Error("file cannot be released, wasn't locked before") - ErrUnauthorizedAccess = Error("file cannot be released, unauthorized access") + ErrFileacquired = Error("file already acquired") + ErrCantReleaseFile = Error("file cannot be released, wasn't locked before") + ErrUnauthorizedAccess = Error("file cannot be released, unauthorized access") + ErrCheckacquireFailure = Error("file is not acquired") + ErrFileUnlocked = Error("file doesn't have a lock") ) diff --git a/internal/lockservice/lockservice.go b/internal/lockservice/lockservice.go index 7c40379..761860d 100644 --- a/internal/lockservice/lockservice.go +++ b/internal/lockservice/lockservice.go @@ -12,9 +12,10 @@ type LockService interface { // An error is generated if the same isn't possible for any reason, // including releasing locks on non-acquired descriptors. Release(Descriptors) error - // CheckAcquire checks whether a lock has been acquired on the given descriptor. + // Checkacquire checks whether a lock has been acquired on the given descriptor. // The function returns true if the lock has been acquired on the component. - CheckAcquired(Descriptors) bool + // It also returns the owner of the lock on query. + CheckAcquired(Descriptors) (string, bool) // CheckRelease checks whether a lock has been released (or not acquired) on the // given component. Returns true if there are no locks on the descriptor. CheckReleased(Descriptors) bool diff --git a/internal/lockservice/simpleLockService.go b/internal/lockservice/simpleLockService.go index 42e4fad..23a0f0f 100644 --- a/internal/lockservice/simpleLockService.go +++ b/internal/lockservice/simpleLockService.go @@ -18,11 +18,23 @@ type SimpleConfig struct { PortAddr string } +// LockRequest is an instance of a request for a lock. type LockRequest struct { FileID string `json:"FileID"` UserID string `json:"UserID"` } +// LockCheckRequest is an instance of a lock check request. +type LockCheckRequest struct { + FileID string `json:"FileID"` +} + +// CheckacquireRes is the response of a Checkacquire. +type CheckacquireRes struct { + Owner string `json:"owner"` +} + +// IP returns the IP from the SimpleConfig. func (scfg *SimpleConfig) IP() string { return scfg.IPAddr } @@ -42,27 +54,34 @@ type SimpleLockService struct { lockMap *SafeLockMap } -var _ Descriptors = (*SimpleDescriptor)(nil) +var _ Descriptors = (*LockDescriptor)(nil) -// SimpleDescriptor implements the Descriptors interface. +// ObjectDescriptor describes the object that is subjected to +// lock operations. +type ObjectDescriptor struct { + ObjectID string +} + +// LockDescriptor implements the Descriptors interface. // Many descriptors can be added to this struct and the ID // can be a combination of all those descriptors. -type SimpleDescriptor struct { +type LockDescriptor struct { FileID string UserID string } // ID represents the distinguishable ID of the descriptor. -func (sd *SimpleDescriptor) ID() string { +func (sd *LockDescriptor) ID() string { return sd.FileID } // Owner represents the distinguishable ID of the entity that // holds the lock for FileID. -func (sd *SimpleDescriptor) Owner() string { +func (sd *LockDescriptor) Owner() string { return sd.UserID } +// NewSimpleConfig returns an instance of the SimpleConfig. func NewSimpleConfig(IPAddr, PortAddr string) *SimpleConfig { return &SimpleConfig{ IPAddr: IPAddr, @@ -70,13 +89,21 @@ func NewSimpleConfig(IPAddr, PortAddr string) *SimpleConfig { } } -func NewSimpleDescriptor(FileID, UserID string) *SimpleDescriptor { - return &SimpleDescriptor{ +// NewLockDescriptor returns an instance of the LockDescriptor. +func NewLockDescriptor(FileID, UserID string) *LockDescriptor { + return &LockDescriptor{ FileID: FileID, UserID: UserID, } } +// NewObjectDescriptor returns an instance of the ObjectDescriptor. +func NewObjectDescriptor(ObjectID string) *ObjectDescriptor { + return &ObjectDescriptor{ + ObjectID: ObjectID, + } +} + // NewSimpleLockService creates and returns a new lock service ready to use. func NewSimpleLockService(log zerolog.Logger) *SimpleLockService { safeLockMap := &SafeLockMap{ @@ -88,7 +115,7 @@ func NewSimpleLockService(log zerolog.Logger) *SimpleLockService { } } -// Acquire function lets a client acquire a lock on an object. +// Acquire function lets a client Acquire a lock on an object. func (ls *SimpleLockService) Acquire(sd Descriptors) error { ls.lockMap.Mutex.Lock() if _, ok := ls.lockMap.LockMap[sd.ID()]; ok { @@ -98,7 +125,7 @@ func (ls *SimpleLockService) Acquire(sd Descriptors) error { Debug(). Str("descriptor", sd.ID()). Msg("can't acquire, already been acquired") - return ErrFileAcquired + return ErrFileacquired } ls.lockMap.LockMap[sd.ID()] = sd.Owner() ls.lockMap.Mutex.Unlock() @@ -106,6 +133,7 @@ func (ls *SimpleLockService) Acquire(sd Descriptors) error { log. Debug(). Str("descriptor", sd.ID()). + Str("owner", sd.Owner()). Msg("locked") return nil } @@ -121,6 +149,7 @@ func (ls *SimpleLockService) Release(sd Descriptors) error { log. Debug(). Str("descriptor", sd.ID()). + Str("owner", sd.Owner()). Msg("released") ls.lockMap.Mutex.Unlock() return nil @@ -146,44 +175,47 @@ func (ls *SimpleLockService) Release(sd Descriptors) error { } -// CheckAcquired returns true if the file is acquired -func (ls *SimpleLockService) CheckAcquired(sd Descriptors) bool { +// CheckAcquired returns true if the file is Acquired. +// It also returns the owner of the file. +func (ls *SimpleLockService) CheckAcquired(sd Descriptors) (string, bool) { ls.lockMap.Mutex.Lock() - if _, ok := ls.lockMap.LockMap[sd.ID()]; ok { + id := sd.ID() + if owner, ok := ls.lockMap.LockMap[id]; ok { ls.lockMap.Mutex.Unlock() ls. log. Debug(). - Str("descriptor", sd.ID()). - Msg("checkAcquire success") - return true + Str("descriptor", id). + Msg("checkacquire success") + return owner, true } ls. log. Debug(). - Str("descriptor", sd.ID()). - Msg("check Acquire failure") + Str("descriptor", id). + Msg("check acquire failure") ls.lockMap.Mutex.Unlock() - return false + return "", false } // CheckReleased returns true if the file is released func (ls *SimpleLockService) CheckReleased(sd Descriptors) bool { ls.lockMap.Mutex.Lock() - if _, ok := ls.lockMap.LockMap[sd.ID()]; ok { + id := sd.ID() + if _, ok := ls.lockMap.LockMap[id]; ok { ls.lockMap.Mutex.Unlock() ls. log. Debug(). - Str("descriptor", sd.ID()). + Str("descriptor", id). Msg("checkRelease failure") return false } + ls.lockMap.Mutex.Unlock() ls. log. Debug(). - Str("descriptor", sd.ID()). + Str("descriptor", id). Msg("checkRelease success") - ls.lockMap.Mutex.Unlock() return true } diff --git a/internal/routing/acquire.go b/internal/routing/acquire.go index c4decb5..84d2028 100644 --- a/internal/routing/acquire.go +++ b/internal/routing/acquire.go @@ -8,8 +8,7 @@ import ( "github.com/SystemBuilders/LocKey/internal/lockservice" ) -// type Request = lockservice.Request - +// acquire wraps the lock Acquire function and creates a clean HTTP service. func acquire(w http.ResponseWriter, r *http.Request, ls *lockservice.SimpleLockService) { body, err := ioutil.ReadAll(r.Body) @@ -26,7 +25,7 @@ func acquire(w http.ResponseWriter, r *http.Request, ls *lockservice.SimpleLockS return } - desc := &lockservice.SimpleDescriptor{ + desc := &lockservice.LockDescriptor{ FileID: req.FileID, UserID: req.UserID, } @@ -48,7 +47,7 @@ func checkAcquired(w http.ResponseWriter, r *http.Request, ls *lockservice.Simpl return } - var req lockservice.LockRequest + var req lockservice.LockCheckRequest err = json.Unmarshal(body, &req) if err != nil { @@ -56,13 +55,19 @@ func checkAcquired(w http.ResponseWriter, r *http.Request, ls *lockservice.Simpl return } - desc := &lockservice.SimpleDescriptor{ + desc := &lockservice.LockDescriptor{ FileID: req.FileID, - UserID: req.UserID, } - if ls.CheckAcquired(desc) { - w.Write([]byte("checkAcquire success")) + + owner, ok := ls.CheckAcquired(desc) + if ok { + byteData, err := json.Marshal(lockservice.CheckacquireRes{Owner: owner}) + if err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + w.Write(byteData) return } - w.Write([]byte("checkAcquire failure")) + http.Error(w, lockservice.ErrCheckacquireFailure.Error(), http.StatusInternalServerError) } diff --git a/internal/routing/release.go b/internal/routing/release.go index c60942e..27d7c85 100644 --- a/internal/routing/release.go +++ b/internal/routing/release.go @@ -24,7 +24,7 @@ func release(w http.ResponseWriter, r *http.Request, ls *lockservice.SimpleLockS return } - desc := &lockservice.SimpleDescriptor{ + desc := &lockservice.LockDescriptor{ FileID: req.FileID, UserID: req.UserID, } @@ -59,7 +59,7 @@ func checkReleased(w http.ResponseWriter, r *http.Request, ls *lockservice.Simpl return } - desc := &lockservice.SimpleDescriptor{ + desc := &lockservice.LockDescriptor{ FileID: req.FileID, UserID: req.UserID, } diff --git a/internal/routing/routing.go b/internal/routing/routing.go index 575c96f..5ae5c61 100644 --- a/internal/routing/routing.go +++ b/internal/routing/routing.go @@ -9,20 +9,20 @@ import ( // SetupRouting adds all the routes on the http server. func SetupRouting(ls *lockservice.SimpleLockService, r *mux.Router) *mux.Router { - r.HandleFunc("/acquire", makeAcquireHandler(ls)).Methods(http.MethodPost) - r.HandleFunc("/checkAcquire", makeCheckAcquiredHandler(ls)).Methods(http.MethodPost) + r.HandleFunc("/acquire", makeacquireHandler(ls)).Methods(http.MethodPost) + r.HandleFunc("/checkacquire", makeCheckacquiredHandler(ls)).Methods(http.MethodPost) r.HandleFunc("/release", makeReleaseHandler(ls)).Methods(http.MethodPost) r.HandleFunc("/checkRelease", makeCheckReleaseHandler(ls)).Methods(http.MethodPost) return r } -func makeAcquireHandler(ls *lockservice.SimpleLockService) http.HandlerFunc { +func makeacquireHandler(ls *lockservice.SimpleLockService) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { acquire(w, r, ls) } } -func makeCheckAcquiredHandler(ls *lockservice.SimpleLockService) http.HandlerFunc { +func makeCheckacquiredHandler(ls *lockservice.SimpleLockService) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { checkAcquired(w, r, ls) }