{"record":{"id":"b3c398f9ab116b48","repo":"apache/iceberg","slug":"invalid-operator-event-type-b3c398","errorCode":null,"errorMessage":"Invalid operator event type: ","messagePattern":"Invalid operator event type: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/TriggerManagerCoordinator.java","lineNumber":48,"sourceCode":"  TriggerManagerCoordinator(String operatorName, Context context) {\n    super(operatorName, context);\n    LOG.info(\"Created TriggerManagerCoordinator: {}\", operatorName);\n  }\n\n  @Override\n  public void handleEventFromOperator(int subtask, int attemptNumber, OperatorEvent event) {\n    runInCoordinatorThread(\n        () -> {\n          LOG.debug(\n              \"Handling event from subtask {} (#{}) of {}: {}\",\n              subtask,\n              attemptNumber,\n              operatorName(),\n              event);\n          if (event instanceof LockRegisterEvent) {\n            registerLock((LockRegisterEvent) event);\n          } else {\n            throw new IllegalArgumentException(\n                \"Invalid operator event type: \" + event.getClass().getCanonicalName());\n          }\n        },\n        String.format(\n            Locale.ROOT,\n            \"handling operator event %s from subtask %d (#%d)\",\n            event.getClass(),\n            subtask,\n            attemptNumber));\n  }\n}\n","sourceCodeStart":30,"sourceCodeEnd":60,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/TriggerManagerCoordinator.java#L30-L60","documentation":"TriggerManagerCoordinator.handleEventFromOperator() only accepts LockRegisterEvent from its subtasks. Any other OperatorEvent type is an internal protocol violation and is thrown as IllegalArgumentException naming the event class.","triggerScenarios":"A TriggerManagerOperator (or custom operator) sends an OperatorEvent other than LockRegisterEvent to this coordinator, e.g. LockReleaseEvent or a custom event.","commonSituations":"Custom operators wired into the maintenance job chain sending wrong events; mixing operator versions across a savepoint restore so old code sends events the new coordinator doesn't know; misconfiguration of the operator chain.","solutions":["Ensure only TriggerManagerOperator paired with this coordinator is in the job; verify no custom code sends other events to it","Check for version skew: if restoring from a savepoint, use the same Iceberg version for all job vertices","Review operator EventSender/Coordinator setup to confirm the coordinator is registered for the right operator","If adding new event types, extend handleEventFromOperator to handle them explicitly"],"exampleFix":"// before\neventGateway.sendToCoordinator(new LockReleaseEvent(lockId)); // to TriggerManagerCoordinator\n// after\neventGateway.sendToCoordinator(new LockRegisterEvent(lockFactory, lockId));","handlingStrategy":"type-guard","validationCode":"// before sending an event to TriggerManagerCoordinator\nif (!(event instanceof LockRegisterEvent)) {\n  throw new IllegalArgumentException(\"TriggerManagerCoordinator only accepts LockRegisterEvent, got \" + event.getClass());\n}","typeGuard":"if (event instanceof LockRegisterEvent lockRegister) {\n  eventGateway.sendToCoordinator(lockRegister);\n} else { /* handle elsewhere */ }","tryCatchPattern":"try {\n  coordinator.handleEventFromOperator(...);\n} catch (IllegalArgumentException e) {\n  LOG.error(\"Wrong OperatorEvent sent to TriggerManagerCoordinator\", e);\n  throw e;\n}","preventionTips":["Only pair TriggerManagerOperator with TriggerManagerCoordinator in the job graph","Send each event type only to its designated coordinator/operator","Avoid restoring from savepoints written by different Iceberg versions"],"tags":["flink","operator-event","coordinator","illegal-argument"],"backgroundTag":"invalid-argument-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}