Call unlockPack in finally
The lock is obtained in receivePackAndCheckConnectivity. It seems to me the structure that requres the caller to unlock the lock is wrong, but at least by calling in finally ensures it is called even if an exception is thrown. Change-Id: I123841b017baf5acffe0064d1004ef11a0a5e6c2 Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
This commit is contained in:
parent
54dd1d112a
commit
ad379793c7
|
@ -269,20 +269,26 @@ private void service() throws IOException {
|
|||
}
|
||||
}
|
||||
|
||||
try {
|
||||
if (unpackError == null) {
|
||||
boolean atomic = isCapabilityEnabled(CAPABILITY_ATOMIC);
|
||||
setAtomic(atomic);
|
||||
|
||||
validateCommands();
|
||||
if (atomic && anyRejects())
|
||||
if (atomic && anyRejects()) {
|
||||
failPendingCommands();
|
||||
}
|
||||
|
||||
preReceive.onPreReceive(this, filterCommands(Result.NOT_ATTEMPTED));
|
||||
if (atomic && anyRejects())
|
||||
preReceive.onPreReceive(
|
||||
this, filterCommands(Result.NOT_ATTEMPTED));
|
||||
if (atomic && anyRejects()) {
|
||||
failPendingCommands();
|
||||
}
|
||||
executeCommands();
|
||||
}
|
||||
} finally {
|
||||
unlockPack();
|
||||
}
|
||||
|
||||
if (reportStatus) {
|
||||
if (echoCommandFailures && msgOut != null) {
|
||||
|
|
Loading…
Reference in New Issue