Skip to content

Commit

Permalink
Clarify coders for side inputs on err output. (#27568)
Browse files Browse the repository at this point in the history
* Clarify coders for side inputs on err output.

* error tracking in harness.

---------

Co-authored-by: lostluck <13907733+lostluck@users.noreply.github.com>
  • Loading branch information
lostluck and lostluck authored Jul 20, 2023
1 parent 9249674 commit a950ac9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sdks/go/pkg/beam/core/runtime/exec/pardo.go
Original file line number Diff line number Diff line change
Expand Up @@ -552,5 +552,5 @@ func (n *ParDo) fail(err error) error {
}

func (n *ParDo) String() string {
return fmt.Sprintf("ParDo[%v] Out:%v Sig: %v", path.Base(n.Fn.Name()), IDs(n.Out...), n.Fn.ProcessElementFn().Fn.Type())
return fmt.Sprintf("ParDo[%v] Out:%v Sig: %v, SideInputs: %v", path.Base(n.Fn.Name()), IDs(n.Out...), n.Fn.ProcessElementFn().Fn.Type(), n.Side)
}
2 changes: 1 addition & 1 deletion sdks/go/pkg/beam/core/runtime/exec/sideinput.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func (s *sideInputAdapter) NewKeyedIterable(ctx context.Context, reader StateRea
}

func (s *sideInputAdapter) String() string {
return fmt.Sprintf("SideInputAdapter[%v, %v]", s.sid, s.sideInputID)
return fmt.Sprintf("SideInputAdapter[%v, %v] - Coder %v", s.sid, s.sideInputID, s.c)
}

// proxyReStream is a simple wrapper of an open function.
Expand Down
4 changes: 3 additions & 1 deletion sdks/go/pkg/beam/core/runtime/harness/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ func (c *control) handleInstruction(ctx context.Context, req *fnpb.InstructionRe
c.mu.Unlock()

if err != nil {
return fail(ctx, instID, "Failed: %v", err)
c.failed[instID] = err
return fail(ctx, instID, "ProcessBundle failed: %v", err)
}

tokens := msg.GetCacheTokens()
Expand Down Expand Up @@ -427,6 +428,7 @@ func (c *control) handleInstruction(ctx context.Context, req *fnpb.InstructionRe
// If there was an error on the data channel reads, fail this bundle
// since we may have had a short read.
c.failed[instID] = dataError
err = dataError
} else {
// Non failure plans should either be moved to the finalized state
// or to plans so they can be re-used.
Expand Down

0 comments on commit a950ac9

Please sign in to comment.