Call the method lock.lock() immediately after getting the lock. Otherwise, if an exception happened between the two calls (in another word, lock.lock() was called), lock.unlock() can cause an issue: Current thread is not owner of lock! See https://redmine.dataone.org/issues/6836.
Call the method lock.lock() immediately after getting the lock. Otherwise, if an exception happened between the two calls (in another word, lock.lock() was called), lock.unlock() can cause an issue:
Current thread is not owner of lock!
See https://redmine.dataone.org/issues/6836.