{"record":{"id":"89b327e003a54e09","repo":"alibaba/nacos","slug":"cancel-wait-error","errorCode":null,"errorMessage":"cancel wait error.","messagePattern":"cancel wait error\\.","errorType":"exception","errorClass":"NacosLockException","httpStatus":null,"severity":"error","filePath":"lock/src/main/java/com/alibaba/nacos/lock/service/impl/LockOperationServiceImpl.java","lineNumber":302,"sourceCode":"        lockInfo.setKey(new LockKey(lockInstance.getLockType(), lockInstance.getKey()));\n        lockInfo.setOwner(lockInstance.getOwner());\n        lockInfo.setConnectionId(connectionId);\n        request.setLockInfo(lockInfo);\n        WriteRequest writeRequest = WriteRequest.newBuilder().setGroup(group())\n            .setData(ByteString.copyFrom(serializer.serialize(request)))\n            .setOperation(LockOperationEnum.CANCEL_WAIT.name()).build();\n        try {\n            Response response = protocol.write(writeRequest);\n            if (response.getSuccess()) {\n                return serializer.deserialize(response.getData().toByteArray());\n            }\n            throw new NacosLockException(response.getErrMsg());\n        } catch (NacosLockException e) {\n            LOGGER.error(\"key: {}, lockType:{} cancel wait fail, errorMsg: {}\",\n                lockInstance.getKey(), lockInstance.getLockType(), e.getMessage());\n            throw e;\n        } catch (Exception e) {\n            throw new NacosLockException(\"cancel wait error.\", e);\n        }\n    }\n    \n    private LockResult expireLock(MutexLockRequest request) {\n        LockInfo lockInfo = request.getLockInfo();\n        AtomicLockService mutexLock = lockManager.getMutexLock(lockInfo.getKey());\n        if (mutexLock instanceof AbstractAtomicLock) {\n            AbstractAtomicLock atomicLock = (AbstractAtomicLock) mutexLock;\n            Boolean expired = atomicLock.autoExpire();\n            if (expired) {\n                if (atomicLock.isClear()) {\n                    boolean hasWaiters = atomicLock.hasWaiters();\n                    if (hasWaiters) {\n                        WaitEntry entry = atomicLock.peekFirstWaiter();\n                        if (entry != null) {\n                            LockKey lockKey = lockInfo.getKey();\n                            LockNotificationRequest notification =\n                                LockNotificationRequest.available(","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/lock/src/main/java/com/alibaba/nacos/lock/service/impl/LockOperationServiceImpl.java#L284-L320","documentation":"Error \"cancel wait error.\" thrown in alibaba/nacos.","triggerScenarios":"Thrown at lock/src/main/java/com/alibaba/nacos/lock/service/impl/LockOperationServiceImpl.java:302 when the library encounters an invalid state.","commonSituations":"Cancelling a pending lock wait failed.","solutions":["Inspect the server logs for the underlying cause, fix it, and retry the operation."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}