release the lock in a finally block and process the request only if the lock is acquired