quarkusio/quarkus · error · RuntimeException

Failed to create Worker for ${workerName}

Error message

Failed to create Worker for ${workerName}

What it means

QuarkusWorkerPoolRegistry.getWorker tries to obtain/create the worker pool referenced by a @Blocking annotation. When the executor could not be created for the given worker name it throws RuntimeException 'Failed to create Worker for <name>'. This is a runtime failure of worker pool provisioning, typically after defineWorker registered a pool that cannot be instantiated.

Source

Thrown at extensions/smallrye-reactive-messaging/runtime/src/main/java/io/quarkus/smallrye/reactivemessaging/runtime/QuarkusWorkerPoolRegistry.java:260

        if (workerConfig.containsKey(workerName)) {
            WorkerExecutor executor = workerExecutors.get(workerName);
            if (executor == null) {
                synchronized (this) {
                    executor = workerExecutors.get(workerName);
                    if (executor == null) {
                        WorkerPoolConfig config = workerConfig.get(workerName);
                        executor = executionHolder.vertx().createSharedWorkerExecutor(workerName,
                                config.maxConcurrency());
                        log.infof("Created worker pool named %s with concurrency of %d", workerName,
                                config.maxConcurrency());
                        workerExecutors.put(workerName, executor);
                    }
                }
            }
            if (executor != null) {
                return executor;
            } else {
                throw new RuntimeException("Failed to create Worker for " + workerName);
            }
        }

        // Shouldn't get here
        throw new IllegalArgumentException("@Blocking referred to invalid worker name. " + workerName);
    }

    public void defineWorker(String className, String method, String poolName, boolean virtualThread) {
        Objects.requireNonNull(className, "className was empty");
        Objects.requireNonNull(method, "Method was empty");
        if (virtualThread) {
            virtualThreadWorkers.add(poolName);
            return;
        }

        if (!poolName.equals(Blocking.DEFAULT_WORKER_POOL)) {
            // Validate @Blocking value is not empty, if set
            if (Validation.isBlank(poolName)) {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Check worker pool configuration properties (quarkus.thread-pool.max-threads etc.) for invalid values.
  2. Verify defineWorker was called with a valid pool name matching @Blocking's value.
  3. Inspect the underlying cause logged by the executor factory.
  4. Simplify to default @Blocking (no name) to use the default worker pool.

Example fix

// before
@Blocking("borked-pool")
void consume(String m) { ... }
// after
@Blocking
void consume(String m) { ... }
Defensive patterns

Strategy: try-catch

Try / catch

try {
    Worker w = registry.getWorker(workerName);
} catch (RuntimeException e) {
    if (e.getMessage().contains("Failed to create Worker for " + workerName)) {
        // fall back to default worker
        w = registry.getWorker("");
    } else throw e;
}

Prevention

When it happens

Trigger: @Blocking("myPool") where the registry fails to create the executor for 'myPool' at lookup time (e.g. invalid configuration of max concurrency, executor creation failure).

Common situations: Misconfigured worker pool parameters; racing/incorrect defineWorker calls from the deployment-generated code; virtual vs platform thread pool misconfiguration.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/d25432e9638be43b. Report an issue: GitHub.