[
https://issues.apache.org/jira/browse/IGNITE-25443?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Vyacheslav Koptilin updated IGNITE-25443:
-----------------------------------------
Description:
The following code might lead to the fact that a lock will not be released:
{code:java|title=TabaleManager#beforeZoneReplicaStartedImpl}
CompletableFuture<Long> readLockAcquisitionFuture = zoneLock.readLock();
try {
return readLockAcquisitionFuture.thenCompose(stamp -> {
...
return allOf(futures).whenComplete((unused, t) ->
zoneLock.unlockRead(stamp));
});
} catch (Throwable t) {
readLockAcquisitionFuture.whenComplete((stamp, ex) ->
zoneLock.unlockRead(stamp));
return failedFuture(t);
}
{code}
If an exception is thrown inside `thenCompose`, the lock will not be released.
> TableManager.tablesPerZoneLocks might not released due to an exception
> ----------------------------------------------------------------------
>
> Key: IGNITE-25443
> URL: https://issues.apache.org/jira/browse/IGNITE-25443
> Project: Ignite
> Issue Type: Bug
> Reporter: Vyacheslav Koptilin
> Assignee: Vyacheslav Koptilin
> Priority: Major
> Labels: ignite-3
>
> The following code might lead to the fact that a lock will not be released:
> {code:java|title=TabaleManager#beforeZoneReplicaStartedImpl}
> CompletableFuture<Long> readLockAcquisitionFuture = zoneLock.readLock();
> try {
> return readLockAcquisitionFuture.thenCompose(stamp -> {
> ...
> return allOf(futures).whenComplete((unused, t) ->
> zoneLock.unlockRead(stamp));
> });
> } catch (Throwable t) {
> readLockAcquisitionFuture.whenComplete((stamp, ex) ->
> zoneLock.unlockRead(stamp));
> return failedFuture(t);
> }
> {code}
> If an exception is thrown inside `thenCompose`, the lock will not be released.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)