Netflix/Hystrix · error · RuntimeException

Not an event that can be converted to HystrixEventType : {ev

Error message

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

What it means

HystrixEventType.from(HystrixRollingNumberEvent) converts internal rolling-number metrics events into command event types; the switch has no default mapping for events outside the command domain (thread-pool, collapser, or counters such as EMIT), so it throws RuntimeException('Not an event that can be converted to HystrixEventType : <event>').

Source

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

            case SUCCESS: return SUCCESS;
            case FAILURE: return FAILURE;
            case TIMEOUT: return TIMEOUT;
            case SHORT_CIRCUITED: return SHORT_CIRCUITED;
            case THREAD_POOL_REJECTED: return THREAD_POOL_REJECTED;
            case SEMAPHORE_REJECTED: return SEMAPHORE_REJECTED;
            case FALLBACK_EMIT: return FALLBACK_EMIT;
            case FALLBACK_SUCCESS: return FALLBACK_SUCCESS;
            case FALLBACK_FAILURE: return FALLBACK_FAILURE;
            case FALLBACK_REJECTION: return FALLBACK_REJECTION;
            case FALLBACK_DISABLED: return FALLBACK_DISABLED;
            case FALLBACK_MISSING: return FALLBACK_MISSING;
            case EXCEPTION_THROWN: return EXCEPTION_THROWN;
            case RESPONSE_FROM_CACHE: return RESPONSE_FROM_CACHE;
            case COLLAPSED: return COLLAPSED;
            case BAD_REQUEST: return BAD_REQUEST;
            case COMMAND_MAX_ACTIVE: return COMMAND_MAX_ACTIVE;
            default:
                throw new RuntimeException("Not an event that can be converted to HystrixEventType : " + event);
        }
    }

    /**
     * List of events that throw an Exception to the caller
     */
    public final static List<HystrixEventType> EXCEPTION_PRODUCING_EVENT_TYPES = new ArrayList<HystrixEventType>();

    /**
     * List of events that are terminal
     */
    public final static List<HystrixEventType> TERMINAL_EVENT_TYPES = new ArrayList<HystrixEventType>();

    static {
        EXCEPTION_PRODUCING_EVENT_TYPES.add(BAD_REQUEST);
        EXCEPTION_PRODUCING_EVENT_TYPES.add(FALLBACK_FAILURE);
        EXCEPTION_PRODUCING_EVENT_TYPES.add(FALLBACK_DISABLED);
        EXCEPTION_PRODUCING_EVENT_TYPES.add(FALLBACK_MISSING);

View on GitHub (pinned to 5ce3bc58c3)

Solutions

  1. Route thread-pool events through HystrixEventType.ThreadPool.from() and collapser events through HystrixEventType.Collapser.from() instead
  2. Filter events before conversion (skip counters/EMIT events that have no command mapping)
  3. If writing a custom metrics consumer, unit-test the full HystrixRollingNumberEvent enum against your converter

Example fix

// before
HystrixEventType t = HystrixEventType.from(event); // throws for THREAD_EXECUTION
// after
HystrixEventType t = (event == HystrixRollingNumberEvent.THREAD_EXECUTION)
    ? HystrixEventType.ThreadPool.from(event) == HystrixEventType.ThreadPool.EXECUTED ? HystrixEventType.SUCCESS : null
    : HystrixEventType.from(event);
Defensive patterns

Strategy: validation

Validate before calling

// only command-domain rolling events are convertible
static boolean isCommandEvent(HystrixRollingNumberEvent e) {
  switch (e) { case SUCCESS: case FAILURE: case TIMEOUT: case SHORT_CIRCUITED:
    case THREAD_POOL_REJECTED: case SEMAPHORE_REJECTED: case BAD_REQUEST:
    case FALLBACK_SUCCESS: case FALLBACK_FAILURE: case FALLBACK_REJECTION:
    case FALLBACK_DISABLED: case FALLBACK_MISSING: case EXCEPTION_THROWN:
    case RESPONSE_FROM_CACHE: case COLLAPSED: case FALLBACK_EMIT: case COMMAND_MAX_ACTIVE:
      return true; default: return false; } }

Type guard

null

Try / catch

Not intended to be caught — restrict inputs so from() never receives a foreign event type.

Prevention

When it happens

Trigger: Internal/metrics code calling HystrixEventType.from() with a HystrixRollingNumberEvent like THREAD_EXECUTION, THREAD_POOL_REJECTED, COLLAPSER_BATCH, or a counter-only event (EMIT, COMMAND_MAX_ACTIVE handling aside) that has no command-type counterpart.

Common situations: Almost exclusively a Hystrix-internal or custom-metrics-publisher bug — normal application usage cannot reach it; seen when writing custom HystrixMetricsPublisher/HystrixEventNotifier code that feeds rolling-number events into the wrong converter.

Related errors


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