database/locker: Actually unlock advisory locks
Created by: efritz
Apparently we were hiding error messages on unlock. I'm not sure if there was a recent change or if this has just been a problem for a while, but it may be affecting the lag between an LSIF upload and it being available for queries.
Also apparently we were not always calling Lock/Unlock in the same session (making the Unlock fail silently until now). Holding a lock within a transaction stops the connection from being broken and ensures that the unlock happens in the same session.
In order to ensure this happens, we split the lock method into Lock
and LockInTransaction
that errors when you call with the incorrect txn state.