This is an automated email from the ASF dual-hosted git repository.

lostluck pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new ccf55e7  [BEAM-9615] Recover from registration panics. (#15228)
ccf55e7 is described below

commit ccf55e759a3c86a7d19ee682d0e8101322cda4bb
Author: Robert Burke <[email protected]>
AuthorDate: Thu Jul 29 10:22:06 2021 -0700

    [BEAM-9615] Recover from registration panics. (#15228)
---
 sdks/go/pkg/beam/core/runtime/graphx/schema/schema.go | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/sdks/go/pkg/beam/core/runtime/graphx/schema/schema.go 
b/sdks/go/pkg/beam/core/runtime/graphx/schema/schema.go
index 2e3ea3f..d8ed074 100644
--- a/sdks/go/pkg/beam/core/runtime/graphx/schema/schema.go
+++ b/sdks/go/pkg/beam/core/runtime/graphx/schema/schema.go
@@ -106,7 +106,14 @@ func (r *Registry) RegisterType(ut reflect.Type) {
 }
 
 // reconcileRegistrations actually finishes the registration process.
-func (r *Registry) reconcileRegistrations() error {
+func (r *Registry) reconcileRegistrations() (deferedErr error) {
+       var ut reflect.Type
+       defer func() {
+               if r := recover(); r != nil {
+                       deferedErr = errors.Errorf("panicked: %v", r)
+                       deferedErr = errors.WithContextf(deferedErr, 
"reconciling schema registration for type %v", ut)
+               }
+       }()
        for _, ut := range r.toReconcile {
                check := func(ut reflect.Type) bool {
                        return coder.LookupCustomCoder(ut) != nil

Reply via email to