alibaba/nacos · error · NacosLockException
cancel wait error.
Error message
cancel wait error.
What it means
Error "cancel wait error." thrown in alibaba/nacos.
Source
Thrown at lock/src/main/java/com/alibaba/nacos/lock/service/impl/LockOperationServiceImpl.java:302
lockInfo.setKey(new LockKey(lockInstance.getLockType(), lockInstance.getKey()));
lockInfo.setOwner(lockInstance.getOwner());
lockInfo.setConnectionId(connectionId);
request.setLockInfo(lockInfo);
WriteRequest writeRequest = WriteRequest.newBuilder().setGroup(group())
.setData(ByteString.copyFrom(serializer.serialize(request)))
.setOperation(LockOperationEnum.CANCEL_WAIT.name()).build();
try {
Response response = protocol.write(writeRequest);
if (response.getSuccess()) {
return serializer.deserialize(response.getData().toByteArray());
}
throw new NacosLockException(response.getErrMsg());
} catch (NacosLockException e) {
LOGGER.error("key: {}, lockType:{} cancel wait fail, errorMsg: {}",
lockInstance.getKey(), lockInstance.getLockType(), e.getMessage());
throw e;
} catch (Exception e) {
throw new NacosLockException("cancel wait error.", e);
}
}
private LockResult expireLock(MutexLockRequest request) {
LockInfo lockInfo = request.getLockInfo();
AtomicLockService mutexLock = lockManager.getMutexLock(lockInfo.getKey());
if (mutexLock instanceof AbstractAtomicLock) {
AbstractAtomicLock atomicLock = (AbstractAtomicLock) mutexLock;
Boolean expired = atomicLock.autoExpire();
if (expired) {
if (atomicLock.isClear()) {
boolean hasWaiters = atomicLock.hasWaiters();
if (hasWaiters) {
WaitEntry entry = atomicLock.peekFirstWaiter();
if (entry != null) {
LockKey lockKey = lockInfo.getKey();
LockNotificationRequest notification =
LockNotificationRequest.available(View on GitHub (pinned to 9b989acdf1)
Solutions
- Inspect the server logs for the underlying cause, fix it, and retry the operation.
When it happens
Trigger: Thrown at lock/src/main/java/com/alibaba/nacos/lock/service/impl/LockOperationServiceImpl.java:302 when the library encounters an invalid state.
Common situations: Cancelling a pending lock wait failed.
AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14).
Data as JSON: /api/errors/89b327e003a54e09.
Report an issue: GitHub.