[
https://issues.apache.org/jira/browse/BEAM-11104?focusedWorklogId=755340&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-755340
]
ASF GitHub Bot logged work on BEAM-11104:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 11/Apr/22 17:37
Start Date: 11/Apr/22 17:37
Worklog Time Spent: 10m
Work Description: damccorm commented on code in PR #17334:
URL: https://github.com/apache/beam/pull/17334#discussion_r847579844
##########
sdks/go/pkg/beam/core/runtime/exec/fn.go:
##########
@@ -224,15 +227,21 @@ func (n *invoker) Invoke(ctx context.Context, pn
typex.PaneInfo, ws []typex.Wind
}
// ret1 handles processing of a single return value.
-// Errors or single values are the only options.
+// Errors, single values, or a ProcessContinuation are the only options.
func (n *invoker) ret1(pn typex.PaneInfo, ws []typex.Window, ts
typex.EventTime, r0 interface{}) (*FullValue, error) {
switch {
- case n.outErrIdx >= 0:
+ case n.outErrIdx == 0:
if r0 != nil {
return nil, r0.(error)
}
return nil, nil
- case n.outEtIdx >= 0:
+ case n.outPcIdx == 0:
+ if r0 == nil {
+ panic("invoker.ret1: cannot return a nil process
continuation")
Review Comment:
It would be good to hydrate this panic (and our other panics) with
information about which function is actually causing the problem
```suggestion
panic(fmt.Sprintf("invoker.ret1: cannot return a nil
process continuation from function %v", n.fn.Name()))
```
##########
sdks/go/pkg/beam/core/runtime/exec/fn.go:
##########
@@ -224,14 +227,17 @@ func (n *invoker) Invoke(ctx context.Context, pn
typex.PaneInfo, ws []typex.Wind
}
// ret1 handles processing of a single return value.
-// Errors or single values are the only options.
+// Errors, single values, or a ProcessContinuation are the only options.
func (n *invoker) ret1(pn typex.PaneInfo, ws []typex.Window, ts
typex.EventTime, r0 interface{}) (*FullValue, error) {
switch {
case n.outErrIdx >= 0:
if r0 != nil {
return nil, r0.(error)
}
return nil, nil
+ case n.outPcIdx >= 0:
+ n.ret = FullValue{Windows: ws, Timestamp: ts, Pane: pn,
Continuation: r0.(sdf.ProcessContinuation)}
Review Comment:
Left a comment about the specific string, but I think that is a good thing
and I'd vote we expand to other rets
Issue Time Tracking
-------------------
Worklog Id: (was: 755340)
Time Spent: 8h (was: 7h 50m)
> [Go SDK] DoFn Self Checkpointing
> --------------------------------
>
> Key: BEAM-11104
> URL: https://issues.apache.org/jira/browse/BEAM-11104
> Project: Beam
> Issue Type: Sub-task
> Components: sdk-go
> Reporter: Robert Burke
> Assignee: Jack McCluskey
> Priority: P3
> Time Spent: 8h
> Remaining Estimate: 0h
>
> Allow SplittableDoFns to self checkpoint.
> Design doc:
> https://docs.google.com/document/d/1_JbzjY9JR07ZK5v7PcZevUfzHPsqwzfV7W6AouNpMPk/edit?usp=sharing
--
This message was sent by Atlassian Jira
(v8.20.1#820001)