Define "idle" connections that are safe to close (no transactions, no held locks)
Summary:
Ref T13216. See PHI916. When workers are spending 20 minutes in ssh ... ./run-huge-build.sh, we'd like to drop database connections to reduce the cost of having a large fleet of build agents.
To prepare for this, define what it means for a connection to be "idle": no held locks and no open transactions. These connections are safe to close without loss of state.
Test Plan: See next revision for use.
Reviewers: amckinley
Reviewed By: amckinley
Maniphest Tasks: T13216
Differential Revision: https://secure.phabricator.com/D19823