{"record":{"id":"ee036e11af896788","repo":"apache/beam","slug":"unexpected-time-domain","errorCode":null,"errorMessage":"Unexpected time domain ","messagePattern":"Unexpected time domain ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/harness/src/main/java/org/apache/beam/fn/harness/state/FnApiTimerBundleTracker.java","lineNumber":79,"sourceCode":"\n  @AutoValue\n  public abstract static class Modifications<K> {\n    public abstract NavigableSet<TimerInfo<K>> getModifiedEventTimersOrdered();\n\n    public abstract NavigableSet<TimerInfo<K>> getModifiedProcessingTimersOrdered();\n\n    public abstract NavigableSet<TimerInfo<K>> getModifiedSynchronizedProcessingTimersOrdered();\n\n    public NavigableSet<TimerInfo<K>> getModifiedTimersOrdered(TimeDomain timeDomain) {\n      switch (timeDomain) {\n        case EVENT_TIME:\n          return getModifiedEventTimersOrdered();\n        case PROCESSING_TIME:\n          return getModifiedProcessingTimersOrdered();\n        case SYNCHRONIZED_PROCESSING_TIME:\n          return getModifiedSynchronizedProcessingTimersOrdered();\n        default:\n          throw new RuntimeException(\"Unexpected time domain \" + timeDomain);\n      }\n    }\n\n    public abstract Table<String, String, Timer<K>> getModifiedTimerIds();\n\n    @SuppressWarnings({\"nullness\"})\n    static <K> Modifications<K> create() {\n      Comparator<TimeDomain> timeDomainComparator =\n          (td1, td2) -> {\n            // We prioritize processing-time timers,as those tend to be more latency sensitive.\n            if (td1 == TimeDomain.PROCESSING_TIME && td2 == TimeDomain.EVENT_TIME) {\n              return -1;\n            } else if (td1 == TimeDomain.EVENT_TIME && td2 == TimeDomain.PROCESSING_TIME) {\n              return 1;\n            } else {\n              return td1.compareTo(td2);\n            }\n          };","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/state/FnApiTimerBundleTracker.java#L61-L97","documentation":"FnApiTimerBundleTracker.getModifiedTimersOrdered dispatches on the timer's TimeDomain to return the modified timers in order. If the time domain is none of EVENT_TIME, PROCESSING_TIME, or SYNCHRONIZED_PROCESSING_TIME (e.g. an unknown enum from a newer proto or an unset field), it throws a RuntimeException. This is an internal exhaustive-switch guard.","triggerScenarios":"A timer fire or timer modification carries a TimeDomain value outside the three known domains when the tracker collects ordered modified timers for bundle completion.","commonSituations":"Runner emitting newer TimeDomain enum values against an older harness; null/unset time domain from a malformed timer update; version-skewed deployments.","solutions":["Align runner and SDK harness versions so the TimeDomain enum is understood.","Inspect the timer payload/timers sent by the runner for an unset or unknown domain.","Upgrade Beam to a release handling the domain listed in the failure.","If custom runner integration, restrict emitted domains to the three standard ones."],"exampleFix":"// before: reading raw proto enum without default handling\n// after: upgrade harness to enumerate new domains\nswitch (domain) {\n  case EVENT_TIME: ...;\n  case PROCESSING_TIME: ...;\n  case SYNCHRONIZED_PROCESSING_TIME: ...;\n  default: /* upgrade or reject */ \n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"boolean isKnownDomain(TimeDomain d) {\n  return d == TimeDomain.EVENT_TIME\n      || d == TimeDomain.PROCESSING_TIME\n      || d == TimeDomain.SYNCHRONIZED_PROCESSING_TIME;\n}","tryCatchPattern":"try {\n  // timer handling\n} catch (RuntimeException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"Unexpected time domain\")) {\n    LOG.error(\"Unknown TimeDomain from runner: {}\", e.getMessage(), e);\n  } else { throw e; }\n}","preventionTips":["Only emit the three standard time domains from custom runners","Keep proto enums in sync with the harness version","Validate timer payloads at the runner boundary"],"tags":["timers","beam","enum","version-mismatch"],"backgroundTag":"invalid-enum-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}