{"record":{"id":"5e53c272d048c538","repo":"apache/beam","slug":"panicked-v","errorCode":null,"errorMessage":"panicked: %v","messagePattern":"panicked: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/schema/schema.go","lineNumber":120,"sourceCode":"var sdfRtrackerType = reflect.TypeOf((*sdf.RTracker)(nil)).Elem()\n\n// RegisterType converts the type to it's schema representation, and converts it back to\n// a synthetic type so we can map from the synthetic type back to the user type.\n// Recursively registers other named struct types in any component parts.\nfunc (r *Registry) RegisterType(ut reflect.Type) {\n\tr.rwmu.Lock()\n\tdefer r.rwmu.Unlock()\n\tr.toReconcile = append(r.toReconcile, ut)\n}\n\n// reconcileRegistrations actually finishes the registration process.\nfunc (r *Registry) reconcileRegistrations() (deferedErr error) {\n\tr.rwmu.Lock()\n\tdefer r.rwmu.Unlock()\n\tvar ut reflect.Type\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tdeferedErr = errors.Errorf(\"panicked: %v\", r)\n\t\t\tdeferedErr = errors.WithContextf(deferedErr, \"reconciling schema registration for type %v\", ut)\n\t\t}\n\t}()\n\tfor _, ut := range r.toReconcile {\n\t\tcheck := func(ut reflect.Type) bool {\n\t\t\treturn coder.LookupCustomCoder(ut) != nil\n\t\t}\n\t\t// We could have either a pointer or non pointer here,\n\t\t// so we strip pointerness and then check both.\n\t\tvT := reflectx.SkipPtr(ut)\n\t\tif check(vT) || check(reflect.PtrTo(vT)) {\n\t\t\tcontinue\n\t\t}\n\t\tif err := r.registerType(ut, map[reflect.Type]struct{}{}); err != nil {\n\t\t\treturn errors.Wrapf(err, \"error reconciling type %v\", ut)\n\t\t}\n\t}\n\tr.toReconcile = nil","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/schema/schema.go#L102-L138","documentation":"Registry.reconcileRegistrations processes queued types for schema registration inside a locked section. If any registration work panics (reflect panics, nil derefs, etc.), the deferred recover converts the panic into this wrapped error instead of crashing. The error is augmented with context naming the type being reconciled.","triggerScenarios":"Any panic during reconcileRegistrations, e.g. when coder.LookupCustomCoder or registerType panics on a pathological reflect.Type queued via RegisterType/Registered/FromType/ToType.","commonSituations":"Registering exotic types (unsafe pointers, recursive types) into the schema registry; bugs in custom coders or logical type providers invoked during reconciliation.","solutions":["Look at the wrapped context to find the type whose reconciliation panicked, then avoid registering that type or fix its custom coder.","Fix the panicking provider/registration function so it returns errors instead of panicking.","Update the Beam SDK if the panic is a known bug in schema reconciliation."],"exampleFix":"// before: registering a type with a panicking custom coder lookup\nschema.RegisterType(reflect.TypeOf(myBadType{}))\n// after: provide a valid custom coder first\ncoder.LookupCustomCoder(reflect.TypeOf(myBadType{})) // ensure non-panic, register custom coder","handlingStrategy":"try-catch","validationCode":"// validate types before registering\nif t.Kind() == reflect.UnsafePointer || t.Kind() == reflect.Chan {\n    return errors.New(\"type not schema-serializable\")\n}","typeGuard":null,"tryCatchPattern":"defer func() {\n    if r := recover(); r != nil {\n        err = fmt.Errorf(\"schema registration panicked: %v\", r)\n    }\n}()","preventionTips":["Only register plain serializable struct types with the schema registry","Provide custom coders for exotic types instead of schema registration","Keep custom coder lookup functions panic-free"],"tags":["go","beam","schema","panic","reflection"],"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-14T16:17:12.679Z"}