Netflix/Hystrix · error · RuntimeException

Not an event that can be converted to HystrixEventType.Threa

Error message

Not an event that can be converted to HystrixEventType.ThreadPool : {event}

What it means

HystrixEventType.ThreadPool.from(HystrixRollingNumberEvent) maps only THREAD_EXECUTION→EXECUTED and THREAD_POOL_REJECTED→REJECTED; any other HystrixRollingNumberEvent (command success/failure/timeout events, collapser events, counters) hits the default branch and throws RuntimeException('Not an event that can be converted to HystrixEventType.ThreadPool : <event>'). Note the sibling overload from(HystrixEventType) is lenient (returns null) — only the rolling-number overload throws.

Source

Thrown at hystrix-core/src/main/java/com/netflix/hystrix/HystrixEventType.java:116

        EXCEPTION_PRODUCING_EVENT_TYPES.add(FALLBACK_MISSING);
        EXCEPTION_PRODUCING_EVENT_TYPES.add(FALLBACK_REJECTION);

        for (HystrixEventType eventType: HystrixEventType.values()) {
            if (eventType.isTerminal()) {
                TERMINAL_EVENT_TYPES.add(eventType);
            }
        }
    }

    public enum ThreadPool {
        EXECUTED, REJECTED;

        public static ThreadPool from(HystrixRollingNumberEvent event) {
            switch (event) {
                case THREAD_EXECUTION: return EXECUTED;
                case THREAD_POOL_REJECTED: return REJECTED;
                default:
                    throw new RuntimeException("Not an event that can be converted to HystrixEventType.ThreadPool : " + event);
            }
        }

        public static ThreadPool from(HystrixEventType eventType) {
            switch (eventType) {
                case SUCCESS: return EXECUTED;
                case FAILURE: return EXECUTED;
                case TIMEOUT: return EXECUTED;
                case BAD_REQUEST: return EXECUTED;
                case THREAD_POOL_REJECTED: return REJECTED;
                default: return null;
            }
        }
    }

    public enum Collapser {
        BATCH_EXECUTED, ADDED_TO_BATCH, RESPONSE_FROM_CACHE;

View on GitHub (pinned to 5ce3bc58c3)

Solutions

  1. Pre-filter to THREAD_EXECUTION / THREAD_POOL_REJECTED before calling from(), or use switch dispatch on event category first
  2. Use the lenient overload from(HystrixEventType) where a null return is acceptable
  3. Unit-test your converter against every HystrixRollingNumberEvent value

Example fix

// before
for (HystrixRollingNumberEvent e : events) { HystrixEventType.ThreadPool.from(e); } // throws
// after
for (HystrixRollingNumberEvent e : events) {
  if (e == HystrixRollingNumberEvent.THREAD_EXECUTION || e == HystrixRollingNumberEvent.THREAD_POOL_REJECTED)
    HystrixEventType.ThreadPool.from(e);
}
Defensive patterns

Strategy: validation

Validate before calling

static boolean isThreadPoolEvent(HystrixRollingNumberEvent e) {
  return e == HystrixRollingNumberEvent.THREAD_EXECUTION || e == HystrixRollingNumberEvent.THREAD_POOL_REJECTED; }

Type guard

null

Try / catch

Not intended to be caught — pre-filter to the two mappable events.

Prevention

When it happens

Trigger: Calling HystrixEventType.ThreadPool.from() with a command-domain or collapser rolling-number event, e.g. SUCCESS, FAILURE, TIMEOUT, COLLAPSER_BATCH, EXCEPTION_THROWN.

Common situations: Custom metrics publishers or monitoring bridges that iterate all rolling-number events and feed each into the thread-pool converter; also code copied from Hystrix internal metrics consumers without the event-type filter.

Related errors


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