Netflix/Hystrix · error · RuntimeException

unsupported execution type: {}

Error message

unsupported execution type: {}

What it means

CommandExecutor.execute dispatches on ExecutionType (SYNCHRONOUS, ASYNCHRONOUS, OBSERVABLE) derived from the method's return type; any other/null value falls to the default branch and throws RuntimeException. In practice this signals an internal inconsistency — the execution type computed by MetaHolder did not match one of the known enum constants — rather than a normal user configuration error.

Source

Thrown at hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/command/CommandExecutor.java:67

        switch (executionType) {
            case SYNCHRONOUS: {
                return castToExecutable(invokable, executionType).execute();
            }
            case ASYNCHRONOUS: {
                HystrixExecutable executable = castToExecutable(invokable, executionType);
                if (metaHolder.hasFallbackMethodCommand()
                        && ExecutionType.ASYNCHRONOUS == metaHolder.getFallbackExecutionType()) {
                    return new FutureDecorator(executable.queue());
                }
                return executable.queue();
            }
            case OBSERVABLE: {
                HystrixObservable observable = castToObservable(invokable);
                return ObservableExecutionMode.EAGER == metaHolder.getObservableExecutionMode() ? observable.observe() : observable.toObservable();
            }
            default:
                throw new RuntimeException("unsupported execution type: " + executionType);
        }
    }

    private static HystrixExecutable castToExecutable(HystrixInvokable invokable, ExecutionType executionType) {
        if (invokable instanceof HystrixExecutable) {
            return (HystrixExecutable) invokable;
        }
        throw new RuntimeException("Command should implement " + HystrixExecutable.class.getCanonicalName() + " interface to execute in: " + executionType + " mode");
    }

    private static HystrixObservable castToObservable(HystrixInvokable invokable) {
        if (invokable instanceof HystrixObservable) {
            return (HystrixObservable) invokable;
        }
        throw new RuntimeException("Command should implement " + HystrixObservable.class.getCanonicalName() + " interface to execute in observable mode");
    }

}

View on GitHub (pinned to 5ce3bc58c3)

Solutions

  1. Align hystrix-javanica, hystrix-core (and hystrix-metrics-event-stream etc.) to the same released 1.5.x version — check for duplicates with 'mvn dependency:tree | grep hystrix'.
  2. Exclude transitively pulled older/newer javanica jars from other dependencies.
  3. If you extend MetaHolderFactory or CommandExecutor, ensure the produced executionType is one of the three enum constants for every annotated signature.

Example fix

<!-- before: mixed versions -->
<dependency><groupId>com.netflix.hystrix</groupId><artifactId>hystrix-javanica</artifactId><version>1.5.8</version></dependency>
<dependency><groupId>com.netflix.hystrix</groupId><artifactId>hystrix-core</artifactId><version>1.5.18</version></dependency>

<!-- after: aligned -->
<dependency><groupId>com.netflix.hystrix</groupId><artifactId>hystrix-javanica</artifactId><version>1.5.18</version></dependency>
<dependency><groupId>com.netflix.hystrix</groupId><artifactId>hystrix-core</artifactId><version>1.5.18</version></dependency>
Defensive patterns

Strategy: try-catch

Validate before calling

// Verify a single javanica version on classpath at build time:
// mvn dependency:tree -Dincludes=com.netflix.hystrix  -> expect one hystrix-javanica and one hystrix-core version

Try / catch

try { CommandExecutor.execute(invokable, executionType, metaHolder); } catch (RuntimeException e) { if ("unsupported execution type".equals(prefix(e))) { log.error("hystrix version/extension mismatch — audit dependency tree and custom factories"); } throw e; }

Prevention

When it happens

Trigger: metaHolder.getExecutionType() (or collapserExecutionType) returning null or an unexpected value, e.g. after mixing incompatible hystrix-javanica and hystrix-core versions where ExecutionType semantics diverged, or a custom MetaHolderFactory/extension returning a bad type.

Common situations: Version skew between hystrix-contrib/hystrix-javanica and hystrix-core artifacts on the classpath; custom forks or shaded copies of javanica classes; collapser whose execution-type resolution was customized.

Related errors


AI-assisted analysis of Netflix/Hystrix@5ce3bc58c3 (2026-08-14). Data as JSON: /api/errors/2336261948079036. Report an issue: GitHub.