thempatel opened a new issue, #21889:
URL: https://github.com/apache/beam/issues/21889
### What happened?
### Sdk version
v2.36.0
### What operating system and processor architecture are you using?
OS X Monterey Apple M1 Pro (ARM)
### What did you do?
Go test code:
```go
package testbug
import (
"context"
"fmt"
"testing"
"time"
"github.com/apache/beam/sdks/v2/go/pkg/beam"
"github.com/apache/beam/sdks/v2/go/pkg/beam/core/graph/mtime"
"github.com/apache/beam/sdks/v2/go/pkg/beam/core/typex"
"github.com/apache/beam/sdks/v2/go/pkg/beam/testing/passert"
"github.com/apache/beam/sdks/v2/go/pkg/beam/testing/ptest"
)
func init() {
beam.RegisterFunction(dummyFunc)
beam.RegisterFunction(withTimestamp2)
}
func TestWhatHappens(t *testing.T) {
var nums []int
for i := 0; i < 10; i++ {
nums = append(nums, i)
}
p, scp := beam.NewPipelineWithRoot()
msgs := beam.CreateList(scp, nums)
msgs = beam.ParDo(scp, withTimestamp2, msgs)
msgs = beam.AddFixedKey(scp, msgs)
msgs = beam.GroupByKey(scp, msgs)
results := beam.ParDo(scp, dummyFunc, msgs)
passert.Count(scp, results, "numCount", 10)
_ = ptest.RunAndValidate(t, p)
}
func dummyFunc(
_ context.Context,
_ int,
iter func(*typex.EventTime, *int) bool,
emit func(int),
) error {
var (
num int
eventTime typex.EventTime
)
for iter(&eventTime, &num) {
fmt.Printf("%d\n", num)
emit(num)
}
return nil
}
func withTimestamp2(val int) (typex.EventTime, int) {
return mtime.FromTime(time.Now()), val
}
```
### What did you expect to see
This test should complete immediately on ARM
### What did you see instead
This test never ends on ARM
### Prose
I wanted to file this issue to link to the issue I filed with
[golang](https://github.com/golang/go/issues/53395). It appears that the way
the Go SDK dynamically constructs `iter` funcs for `DoFn`'s results in a bug on
ARM architectures where the `iter` never returns false, and thus always appears
to be not exhausted.
### Issue Priority
Priority: 1
### Issue Component
Component: sdk-go
--
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]