[ https://issues.apache.org/jira/browse/BEAM-10310?focusedWorklogId=457438&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-457438 ]
ASF GitHub Bot logged work on BEAM-10310: ----------------------------------------- Author: ASF GitHub Bot Created on: 10/Jul/20 22:45 Start Date: 10/Jul/20 22:45 Worklog Time Spent: 10m Work Description: youngoli commented on a change in pull request #12215: URL: https://github.com/apache/beam/pull/12215#discussion_r453109313 ########## File path: sdks/go/pkg/beam/io/synthetic/source.go ########## @@ -124,8 +125,8 @@ func (fn *sourceFn) Setup() { // ProcessElement creates a number of random elements based on the restriction // tracker received. Each element is a random byte slice key and value, in the // form of KV<[]byte, []byte>. -func (fn *sourceFn) ProcessElement(rt *offsetrange.Tracker, config SourceConfig, emit func([]byte, []byte)) error { - for i := rt.Rest.Start; rt.TryClaim(i) == true; i++ { +func (fn *sourceFn) ProcessElement(rt *sdf.LockRTracker, _ SourceConfig, emit func([]byte, []byte)) error { + for i := rt.Rt.(*offsetrange.Tracker).Rest.Start; rt.TryClaim(i) == true; i++ { Review comment: Hmm, that's a good point. I didn't think about it much because it was fine before, but yeah this wouldn't work now. A split could theoretically be happening while that line is being called, and the tracker would be modified. I'll try adding a getter. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 457438) Time Spent: 40m (was: 0.5h) > Add thread-safe restriction trackers. > ------------------------------------- > > Key: BEAM-10310 > URL: https://issues.apache.org/jira/browse/BEAM-10310 > Project: Beam > Issue Type: Sub-task > Components: sdk-go > Reporter: Daniel Oliveira > Assignee: Daniel Oliveira > Priority: P2 > Time Spent: 40m > Remaining Estimate: 0h > > This specifically means adding a RT wrapper that adds thread-safety to a > restriction tracker, and updating existing SDFs to use that thread-safe > wrapper. -- This message was sent by Atlassian Jira (v8.3.4#803005)