{"record":{"id":"dab898e2686c169f","repo":"xkcoding/spring-boot-demo","slug":"error-dab898","errorCode":null,"errorMessage":"请勿重复提交","messagePattern":"请勿重复提交","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"warning","filePath":"demo-zookeeper/README.md","lineNumber":287,"sourceCode":"     * @throws Throwable 异常信息\n     */\n    @Around(\"doLock()\")\n    public Object around(ProceedingJoinPoint point) throws Throwable {\n        MethodSignature signature = (MethodSignature) point.getSignature();\n        Method method = signature.getMethod();\n        Object[] args = point.getArgs();\n        ZooLock zooLock = method.getAnnotation(ZooLock.class);\n        if (StrUtil.isBlank(zooLock.key())) {\n            throw new RuntimeException(\"分布式锁键不能为空\");\n        }\n        String lockKey = buildLockKey(zooLock, method, args);\n        InterProcessMutex lock = new InterProcessMutex(zkClient, lockKey);\n        try {\n            // 假设上锁成功，以后拿到的都是 false\n            if (lock.acquire(zooLock.timeout(), zooLock.timeUnit())) {\n                return point.proceed();\n            } else {\n                throw new RuntimeException(\"请勿重复提交\");\n            }\n        } finally {\n            lock.release();\n        }\n    }\n\n    /**\n     * 构造分布式锁的键\n     *\n     * @param lock   注解\n     * @param method 注解标记的方法\n     * @param args   方法上的参数\n     * @return\n     * @throws NoSuchFieldException\n     * @throws IllegalAccessException\n     */\n    private String buildLockKey(ZooLock lock, Method method, Object[] args) throws NoSuchFieldException, IllegalAccessException {\n        StringBuilder key = new StringBuilder(KEY_SEPARATOR + KEY_PREFIX + lock.key());","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/xkcoding/spring-boot-demo/blob/87a142f9604c1a5365b4d24d22c2c11c26a9d5ab/demo-zookeeper/README.md#L269-L305","documentation":"README:287 documents the same @ZooLock aspect logic as ZooLockAspect.java:77: when Curator InterProcessMutex.acquire(timeout, unit) returns false within the timeout, the aspect throws RuntimeException('请勿重复提交'). It is the README copy of the runtime duplicate-submission guard.","triggerScenarios":"Concurrent calls to the same @ZooLock method/key; the lock holder outlasts the acquire timeout; a slow/unhealthy ZooKeeper quorum causes acquire to time out.","commonSituations":"Double-click submit; high concurrency on an idempotent endpoint; @ZooLock timeout too short; ZK cluster latency.","solutions":["Increase the @ZooLock timeout","Make the client idempotent (disable submit, idempotency token)","Check ZooKeeper quorum health and session timeouts","Retry with backoff where safe"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// client-side idempotency guard before calling the @ZooLock method\nif (submitting) { return; }\nsubmitting = true;\ntry { lockedService.doWork(req); } finally { submitting = false; }","typeGuard":null,"tryCatchPattern":"try {\n    lockedService.doWork(req);\n} catch (RuntimeException e) {\n    if ('请勿重复提交'.equals(e.getMessage())) {\n        return ApiResponse.of(429, '请求处理中，请勿重复提交', null);\n    }\n    throw e;\n}","preventionTips":["Make the client idempotent (disable submit, idempotency key)","Size @ZooLock timeout to exceed the critical section","Keep the ZooKeeper quorum healthy"],"tags":["zookeeper","distributed-lock","curator","concurrency","documentation"],"backgroundTag":null,"analyzedSha":"87a142f9604c1a5365b4d24d22c2c11c26a9d5ab","analyzedAt":"2026-08-14T01:16:58.217Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}