You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/15 15:22:14 UTC

[GitHub] [beam] thempatel opened a new issue, #21889: [Bug]: GoSdk: Bug in go.reflect results in `iter` funcs passed to `ProcessElement` to never complete on ARM

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: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] thempatel closed issue #21889: [Bug]: GoSdk: Bug in go.reflect results in `iter` funcs passed to `ProcessElement` to never complete on ARM

Posted by GitBox <gi...@apache.org>.
thempatel closed issue #21889: [Bug]: GoSdk: Bug in go.reflect results in `iter` funcs passed to `ProcessElement` to never complete on ARM
URL: https://github.com/apache/beam/issues/21889


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] thempatel commented on issue #21889: [Bug]: GoSdk: Bug in go.reflect results in `iter` funcs passed to `ProcessElement` to never complete on ARM

Posted by GitBox <gi...@apache.org>.
thempatel commented on issue #21889:
URL: https://github.com/apache/beam/issues/21889#issuecomment-1156653498

   It looks like bug fixes will be backported to `go1.18` and go`1.17` ! I am going to close, since that will likely be the best resolution


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org