A fix for the DB synchronization after a restart 76/976/1 master
authorBaha Mesleh <baha.mesleh@nokia.com>
Tue, 11 Jun 2019 13:00:06 +0000 (16:00 +0300)
committerBaha Mesleh <baha.mesleh@nokia.com>
Tue, 11 Jun 2019 13:00:06 +0000 (16:00 +0300)
Changed the lockcli to wait for the shared lock to be released.

Signed-off-by: Baha Mesleh <baha.mesleh@nokia.com>
Change-Id: Ibb3c603cf58cc03e0558a2452288bb610ed18d7d

src/lockcli/handlers.py

index efc911c..36b5eee 100644 (file)
@@ -72,7 +72,7 @@ class CLILockHandler(CLIHandler):
     def __call__(self, args):
         self._init_api(args.server, args.port, args.verbose)
         lock = etcd.Lock(self.client, args.id)
-        result = lock.acquire(blocking=False, lock_ttl=args.timeout)
+        result = lock.acquire(blocking=True, lock_ttl=args.timeout)
         if not result:
             raise Exception('Lock taken!')