damccorm opened a new pull request, #41776:
URL: https://github.com/apache/beam/pull/41776
Note: this PR was auto-generated by tooling. Before moving it out of draft,
the author has done a full review of the PR, specifically evaluating it on the
following criteria:
- The PR is an appropriate fix for the issue (e.g. we're not changing a test
to avoid a bug)
- The PR is a simple fix to the issue (e.g. we're not adding infra when we
could just modify a test)
- The PR is not covering for other problems (e.g. if we're bumping timeouts,
it is not because we're covering for a performance problem)
Full details of the methodology of generation and review can be found here -
https://docs.google.com/document/d/14lj7ECVov4T4EdwmIzNlWrRGE3lLDMOwX5xUMGzaLoc/edit?usp=sharing
If you have concerns with the PR or with the underlying methodology used to
generate this, please comment below - they will be addressed by the author not
the tooling :)
## Summary
Fixes a nil-pointer panic in Prism `stage.Execute`
(`sdks/go/pkg/beam/runners/prism/internal/stage.go`) observed in
`SyntheticPipelineTest.test_synthetic_sdf_step_multiplies_output_elements_count`
in https://github.com/apache/beam/actions/runs/45477417165.
## Production Impact
- **Affected workloads**: Any pipeline executed on the Apache Beam Prism
runner (Go, Python, Java, or YAML) containing runner-executed stages (`s.envID
== ""`, `wk == nil`) under CPU contention or goroutine scheduling delays (does
not affect Cloud Dataflow).
- **Symptom**: `stage.Execute` unconditionally starts a 100ms `progTick`
ticker before entering the `select` loop even when `wk == nil` (where `b.Resp`
and `dataReady` are already closed). If goroutine preemption delays entering
`select` by >= 100ms, Go's `select` can choose `<-progTick.C` and invoke
`b.Progress(ctx, nil)`, panicking with a nil pointer dereference inside
`worker.(*W).sendInstruction`.
- **Resolution**: Only create `progTick` (and adjust `s.baseProgTick` when
`!ticked`) when `wk != nil`, leaving `progTickC` as a `nil` channel for
runner-executed stages so the progress branch is never selected.
## Changes
- `sdks/go/pkg/beam/runners/prism/internal/stage.go`: Guard
`time.NewTicker(baseTick)` and `baseProgTick` adjustment with `wk != nil`, and
select on `progTickC`.
### Verification
- Triggered `beam_PreCommit_GoPrism.yml` workflow run on branch:
[`46452183944`](https://github.com/apache/beam/actions/runs/46452183944)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]