{"record":{"id":"211b2ef2bff42e2a","repo":"apache/druid","slug":"supervisor-does-not-have-the-feature-to-handoff-ta","errorCode":null,"errorMessage":"Supervisor does not have the feature to handoff task groups early implemented","messagePattern":"Supervisor does not have the feature to handoff task groups early implemented","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/indexing/overlord/supervisor/StreamSupervisor.java","lineNumber":70,"sourceCode":"   * @param checkpointMetadata metadata for the sequence to currently checkpoint\n   */\n  void checkpoint(int taskGroupId, DataSourceMetadata checkpointMetadata);\n\n  /**\n   * Computes maxLag, totalLag and avgLag\n   */\n  LagStats computeLagStats();\n\n  int getActiveTaskGroupsCount();\n\n  /**\n   * Marks the given task groups as ready for segment hand-off irrespective of the task run times.\n   * In the subsequent run, the supervisor initiates segment publish and hand-off for these task groups and rolls over their tasks.\n   * taskGroupIds that are not valid or not actively reading are simply ignored.\n   */\n  default void handoffTaskGroupsEarly(List<Integer> taskGroupIds)\n  {\n    throw new UnsupportedOperationException(\"Supervisor does not have the feature to handoff task groups early implemented\");\n  }\n}\n","sourceCodeStart":52,"sourceCodeEnd":73,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/indexing/overlord/supervisor/StreamSupervisor.java#L52-L73","documentation":"The default StreamSupervisor.handoffTaskGroupsEarly is an unsupported-operation stub: supervisors that have not implemented early handoff throw this to signal the feature is unavailable on that supervisor type/implementation.","triggerScenarios":"Calling handoffTaskGroupsEarly(taskGroupIds) (e.g. via the supervisor API to force early handoff) on a supervisor implementation that does not override the default method.","commonSituations":"Invoking early-handoff endpoints against supervisor types lacking the feature; upgrading/using a custom supervisor that never implemented the default interface method introduced later.","solutions":["Upgrade to a supervisor implementation/version that implements early handoff","Use the standard supervisor type that supports the feature, or implement the method in your custom supervisor by marking task groups ready for handoff","Avoid calling the early-handoff API on supervisors that do not advertise support"],"exampleFix":"// before\nsupervisor.handoffTaskGroupsEarly(groupIds); // UnsupportedOperationException\n// after\nif (supervisor.supportsEarlyHandoff()) {\n  supervisor.handoffTaskGroupsEarly(groupIds);\n}","handlingStrategy":"try-catch","validationCode":"// feature probe before invoking\nboolean supported;\ntry { supervisor.getClass().getMethod(\"handoffTaskGroupsEarly\", List.class);\n      supported = !StreamSupervisor.class.getMethod(\"handoffTaskGroupsEarly\", List.class)\n                   .equals(supervisor.getClass().getMethod(\"handoffTaskGroupsEarly\", List.class)); }\ncatch (NoSuchMethodException e) { supported = false; }","typeGuard":"static boolean supportsEarlyHandoff(StreamSupervisor s) {\n  try {\n    return !StreamSupervisor.class.getMethod(\"handoffTaskGroupsEarly\", List.class)\n        .getDeclaringClass().equals(s.getClass().getMethod(\"handoffTaskGroupsEarly\", List.class).getDeclaringClass());\n  } catch (NoSuchMethodException e) { return false; }\n}","tryCatchPattern":"try {\n  supervisor.handoffTaskGroupsEarly(groupIds);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().contains(\"handoff task groups early\")) {\n    log.warn(\"Supervisor \" + supervisor.getClass().getSimpleName() + \" does not support early handoff; waiting for natural handoff\");\n  } else { throw e; }\n}","preventionTips":["Check supervisor type capabilities before calling early-handoff APIs","Pin to a Druid version whose supervisors support early handoff if you rely on it","For custom supervisors, override handoffTaskGroupsEarly rather than inheriting the stub","Handle UnsupportedOperationException gracefully in automation calling this API"],"tags":["unsupported-operation","streaming-ingestion"],"backgroundTag":"method-not-implemented","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}