{"record":{"id":"381166c1710e3fbb","repo":"apache/dubbo","slug":"queue-capacity-is-full","errorCode":null,"errorMessage":"Queue capacity is full.","messagePattern":"Queue capacity is full\\.","errorType":"exception","errorClass":"RejectedExecutionException","httpStatus":null,"severity":"error","filePath":"dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/support/eager/EagerThreadPoolExecutor.java","lineNumber":51,"sourceCode":"            ThreadFactory threadFactory,\n            RejectedExecutionHandler handler) {\n        super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory, handler);\n    }\n\n    @Override\n    public void execute(Runnable command) {\n        if (command == null) {\n            throw new NullPointerException();\n        }\n\n        try {\n            super.execute(command);\n        } catch (RejectedExecutionException rx) {\n            // retry to offer the task into queue.\n            final TaskQueue queue = (TaskQueue) super.getQueue();\n            try {\n                if (!queue.retryOffer(command, 0, TimeUnit.MILLISECONDS)) {\n                    throw new RejectedExecutionException(\"Queue capacity is full.\", rx);\n                }\n            } catch (InterruptedException x) {\n                throw new RejectedExecutionException(x);\n            }\n        }\n    }\n}\n","sourceCodeStart":33,"sourceCodeEnd":59,"githubUrl":"https://github.com/apache/dubbo/blob/3a3043227f5571d25eb2889de5bca22f2914843b/dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/support/eager/EagerThreadPoolExecutor.java#L33-L59","documentation":"Thrown by EagerThreadPoolExecutor.execute() when the executor's initial super.execute() rejects the task AND the subsequent retryOffer() into the TaskQueue also fails (returns false). The EagerThreadPool is designed to create threads eagerly up to max before queuing; this error means even the fallback queue-offer failed — the pool is at maximum threads AND the queue is at capacity. This is a sibling of the standard thread-pool-exhausted scenario but specific to the 'eager' thread pool type.","triggerScenarios":"Using threadpool='eager' configuration: all threads are at maximumPoolSize and the TaskQueue.retryOffer(command, 0, MILLISECONDS) returns false because the underlying LinkedBlockingQueue is full at capacity with zero timeout. This is a transient or sustained overload condition on an eager pool.","commonSituations":"Eager thread pool (threadpool=eager) undersized for load; the TaskQueue capacity is set too low; burst traffic that exceeds both thread creation and queue capacity; slow tasks filling the queue faster than workers drain it.","solutions":["Increase the eager thread pool's max threads (threads parameter) and/or queue capacity (queued parameter / queue capacity).","Switch to 'fixed' or 'cached' thread pool if eager semantics aren't required, to simplify capacity reasoning.","Reduce task execution time or move blocking work off the Dubbo thread pool to a dedicated executor.","Scale providers horizontally to distribute load."],"exampleFix":"// before — eager pool with small queue\n@dubbo.Service(threadpool = \"eager\", threads = 100)\n\n// after — larger threads and queue capacity\n@dubbo.Service(threadpool = \"eager\", threads = 300, queues = 1000)","handlingStrategy":"try-catch","validationCode":"// Check eager pool capacity before submit\nEagerThreadPoolExecutor eagerPool = (EagerThreadPoolExecutor) pool;\nint queueCap = ((TaskQueue<?>) eagerPool.getQueue()).remainingCapacity() + eagerPool.getQueue().size();\nboolean canAccept = !eagerPool.isShutdown()\n    && (eagerPool.getActiveCount() < eagerPool.getMaximumPoolSize()\n        || ((TaskQueue<?>) eagerPool.getQueue()).remainingCapacity() > 0);\nif (!canAccept) {\n    applyBackpressure();\n}","typeGuard":null,"tryCatchPattern":"try {\n    pool.execute(task);\n} catch (RejectedExecutionException e) {\n    if (e.getMessage().contains(\"Queue capacity is full\")) {\n        logger.warn(\"Eager pool queue full, backing off\", e);\n        backoffAndRetry(task); // exponential backoff or external queue\n    } else {\n        throw e;\n    }\n}","preventionTips":["Size the eager pool's threads and queue capacity for peak load.","Set Dubbo timeout to prevent slow tasks from consuming threads.","Use a larger queue capacity (queues parameter) for burst tolerance.","Monitor eager pool metrics (active, queue size) and alert before saturation."],"tags":["thread-pool","eager","capacity","rejected-execution"],"backgroundTag":null,"analyzedSha":"3a3043227f5571d25eb2889de5bca22f2914843b","analyzedAt":"2026-08-14T00:43:19.853Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}