After lock acquire, the remainder should be in a try/except to ensure the lock is released.