{"record":{"id":"e9104acb0e4c80a0","repo":"apache/beam","slug":"unreachable","errorCode":null,"errorMessage":"unreachable","messagePattern":"unreachable","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"sdks/go/pkg/beam/runners/prism/internal/execute.go","lineNumber":430,"sourceCode":"}\n\nfunc getWindowValueCoders(comps *pipepb.Components, col *pipepb.PCollection, coders map[string]*pipepb.Coder) (engine.WinCoderType, exec.WindowDecoder, exec.WindowEncoder) {\n\tws := comps.GetWindowingStrategies()[col.GetWindowingStrategyId()]\n\twcID, err := lpUnknownCoders(ws.GetWindowCoderId(), coders, comps.GetCoders())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn makeWindowCoders(coders[wcID])\n}\n\nfunc getOnlyPair[K comparable, V any](in map[K]V) (K, V) {\n\tif len(in) != 1 {\n\t\tpanic(fmt.Sprintf(\"expected single value map, had %v - %v\", len(in), in))\n\t}\n\tfor k, v := range in {\n\t\treturn k, v\n\t}\n\tpanic(\"unreachable\")\n}\n\nfunc getOnlyValue[K comparable, V any](in map[K]V) V {\n\t_, v := getOnlyPair(in)\n\treturn v\n}\n\n// buildTrigger converts the protocol buffer representation of a trigger\n// to the engine representation.\nfunc buildTrigger(tpb *pipepb.Trigger) engine.Trigger {\n\tswitch at := tpb.GetTrigger().(type) {\n\tcase *pipepb.Trigger_AfterAll_:\n\t\tsubTriggers := make([]engine.Trigger, 0, len(at.AfterAll.GetSubtriggers()))\n\t\tfor _, st := range at.AfterAll.GetSubtriggers() {\n\t\t\tsubTriggers = append(subTriggers, buildTrigger(st))\n\t\t}\n\t\treturn &engine.TriggerAfterAll{SubTriggers: subTriggers}\n\tcase *pipepb.Trigger_AfterAny_:","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/prism/internal/execute.go#L412-L448","documentation":"The final panic(\"unreachable\") in getOnlyPair is a defensive fallthrough: after asserting len(in)==1, the for-range return should always exit the function. Reaching this line means the length check passed but iteration yielded nothing — theoretically impossible for a non-empty map, signaling severe compiler/runtime or state corruption.","triggerScenarios":"Only reachable if the earlier len check is bypassed or the map is mutated concurrently between the check and the range loop.","commonSituations":"Practically never hit by users; appears in stack traces only due to genuine bugs, data races on pipeline components, or binary/codegen anomalies.","solutions":["Check for concurrent modification of pipeline component maps (data race) with the race detector (go run -race).","Verify the beam binary was built from unmodified sources.","If reproducible, report to the Beam project with build details."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"defer func() {\n    if r := recover(); r != nil {\n        log.Fatalf(\"prism internal panic: %v\\n%s\", r, debug.Stack())\n    }\n}()","preventionTips":["Run with -race to detect map mutation races","Build prism from unmodified sources","Report reproducible cases upstream with stack traces"],"tags":["go","panic","unreachable","invariant","beam-prism"],"backgroundTag":"internal-invariant-violation","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"}