use of com.hazelcast.cp.internal.datastructures.lock.operation.UnlockOp in project hazelcast by hazelcast.
the class UnlockMessageTask method processMessage.
@Override
protected void processMessage() {
RaftOp op = new UnlockOp(parameters.name, parameters.sessionId, parameters.threadId, parameters.invocationUid);
invoke(parameters.groupId, op);
}
use of com.hazelcast.cp.internal.datastructures.lock.operation.UnlockOp in project hazelcast by hazelcast.
the class AbstractFencedLockFailureTest method testRetriedUnlockIsSuccessfulAfterLockedByAnotherEndpoint.
@Test(timeout = 300_000)
public void testRetriedUnlockIsSuccessfulAfterLockedByAnotherEndpoint() {
lock.lock();
RaftGroupId groupId = lock.getGroupId();
long sessionId = getSessionManager().getSession(groupId);
RaftInvocationManager invocationManager = getRaftInvocationManager();
UUID invUid = newUnsecureUUID();
invocationManager.invoke(groupId, new UnlockOp(objectName, sessionId, getThreadId(), invUid)).joinInternal();
lockByOtherThread();
invocationManager.invoke(groupId, new UnlockOp(objectName, sessionId, getThreadId(), invUid)).joinInternal();
}
use of com.hazelcast.cp.internal.datastructures.lock.operation.UnlockOp in project hazelcast by hazelcast.
the class AbstractFencedLockAdvancedTest method testInactiveSessionsAreEventuallyClosed.
@Test
public void testInactiveSessionsAreEventuallyClosed() throws ExecutionException, InterruptedException {
lock.lock();
RaftGroupId groupId = (RaftGroupId) lock.getGroupId();
assertTrueEventually(() -> {
for (HazelcastInstance instance : instances) {
RaftSessionService sessionService = getNodeEngineImpl(instance).getService(RaftSessionService.SERVICE_NAME);
assertFalse(sessionService.getAllSessions(groupId).get().isEmpty());
}
});
RaftSessionService sessionService = getNodeEngineImpl(primaryInstance).getService(RaftSessionService.SERVICE_NAME);
long sessionId = sessionService.getAllSessions(groupId).get().iterator().next().id();
getRaftInvocationManager(proxyInstance).invoke(groupId, new UnlockOp(objectName, sessionId, getThreadId(), newUnsecureUUID())).joinInternal();
assertTrueEventually(() -> {
for (HazelcastInstance instance : instances) {
RaftSessionService service = getNodeEngineImpl(instance).getService(RaftSessionService.SERVICE_NAME);
assertTrue(service.getAllSessions(groupId).get().isEmpty());
}
ProxySessionManagerService service = getNodeEngineImpl(proxyInstance).getService(ProxySessionManagerService.SERVICE_NAME);
assertEquals(NO_SESSION_ID, service.getSession(groupId));
});
}
Aggregations