{"record":{"id":"6e31d494bb28cab5","repo":"aeron-io/aeron","slug":"einval-unknown-action","errorCode":"EINVAL","errorMessage":"unknown action","messagePattern":"unknown action","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"aeron-client/src/main/cpp_wrapper/ControlledFragmentAssembler.h","lineNumber":119,"sourceCode":"        ControlledPollAction action = assembler->m_delegate(bufferWrapper, 0, (util::index_t)length, headerWrapper);\n\n        switch (action)\n        {\n            case ControlledPollAction::ABORT:\n                return AERON_ACTION_ABORT;\n                break;\n            case ControlledPollAction::BREAK:\n                return AERON_ACTION_BREAK;\n                break;\n            case ControlledPollAction::COMMIT:\n                return AERON_ACTION_COMMIT;\n                break;\n            case ControlledPollAction::CONTINUE:\n                return AERON_ACTION_CONTINUE;\n                break;\n        }\n\n        throw IllegalArgumentException(\"unknown action\", SOURCEINFO, EINVAL);\n    }\n\n    ControlledPollAction onFragment(AtomicBuffer &buffer, util::index_t offset, util::index_t length, Header &header)\n    {\n        aeron_controlled_fragment_handler_action_t action = aeron_controlled_fragment_assembler_handler(\n            m_fragment_assembler,\n            buffer.buffer() + offset,\n            length,\n            header.hdr());\n\n        switch (action)\n        {\n            case AERON_ACTION_ABORT:\n                return ControlledPollAction::ABORT;\n                break;\n            case AERON_ACTION_BREAK:\n                return ControlledPollAction::BREAK;\n                break;","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-client/src/main/cpp_wrapper/ControlledFragmentAssembler.h#L101-L137","documentation":"Thrown by ControlledFragmentAssembler::handlerCallback when the ControlledPollAction produced by the user's controlled fragment handler does not map to any known aeron_controlled_fragment_handler_action_t value. The switch over ABORT/COMMIT/BREAK/CONTINUE falls through and the wrapper treats it as an internal invariant violation. This means the handler returned an out-of-range or corrupted action value.","triggerScenarios":"A controlledFragmentHandler returning a ControlledPollAction value not covered by the switch (e.g. an uninitialized enum, a cast integer, or a newly added enum value handled by an older wrapper binary).","commonSituations":"Mixing wrapper header versions with compiled handler code where ControlledPollAction gained new enumerators, casting raw ints to ControlledPollAction, or an uninitialized action variable in a custom handler.","solutions":["Audit your controlled fragment handler and ensure every return path yields a defined ControlledPollAction (ABORT, COMMIT, BREAK, CONTINUE).","Initialize the action variable before returning it; never cast raw ints to ControlledPollAction.","Rebuild all handler code with the same Aeron wrapper version as the library you link.","If wrapping a C handler (handlerCallback path), verify the C handler only returns AERON_ACTION_* constants."],"exampleFix":"// before\nControlledPollAction act; // uninitialized\nif (cond) act = ControlledPollAction::BREAK;\nreturn act;\n// after\nif (cond) return ControlledPollAction::BREAK;\nreturn ControlledPollAction::CONTINUE; // always return a defined value","handlingStrategy":"validation","validationCode":"ControlledPollAction sanitize(ControlledPollAction a) {\n  switch (a) {\n    case ControlledPollAction::ABORT:\n    case ControlledPollAction::COMMIT:\n    case ControlledPollAction::BREAK:\n    case ControlledPollAction::CONTINUE:\n      return a;\n    default:\n      return ControlledPollAction::CONTINUE;\n  }\n}","typeGuard":"bool isDefinedAction(ControlledPollAction a) {\n  switch (a) {\n    case ControlledPollAction::ABORT:\n    case ControlledPollAction::COMMIT:\n    case ControlledPollAction::BREAK:\n    case ControlledPollAction::CONTINUE:\n      return true;\n    default:\n      return false;\n  }\n}","tryCatchPattern":"try { subscription.controlledPoll(handler); }\ncatch (const aeron::util::IllegalArgumentException& e) {\n  if (std::string(e.what()) == \"unknown action\") {\n    log(\"handler returned undefined ControlledPollAction\");\n  }\n}","preventionTips":["Always return an explicit enum constant from every handler branch","Initialize action variables at declaration","Never cast raw ints to ControlledPollAction","Rebuild handler code together with the Aeron library version"],"tags":["aeron","cpp","fragment-handler","enum","einval"],"backgroundTag":"invalid-enum-value","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}