Destination#pushWasCanceled: minimize time spent in critical section

When cancelling a push to a replication destination don't notify
listeners about not attempted push during the critical section where the
stateLock is held but do this immediately after the critical section.

We observed in a high-availability setup with 2 primaries that
cancelling a replication push blocked >90 other threads trying to
update some refs which tried to create new replication tasks via
synchronous events. Cancelling the push was stuck on visibility checks
done in EventBroker#fireEvent triggered by Destination#pushWasCanceled.
This visibility check was slow since the affected repository is huge
(30GiB) and we use NFS for sharing repositories between primaries.

Moving the call to PushOne#notifyNotAttempted outside the critical
section should reduce the impact of this critical section on other
requests updating refs concurrently.

Change-Id: I085700c3f4cad95ef62521527ac4b920a59c76c2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
1 file changed
tree: f04d274fb0db78487095cda3ca21f85fd58936ef
  1. .settings/
  2. src/
  3. .gitignore
  4. .mailmap
  5. BUILD
  6. LICENSE