GitHub user rangadi opened a pull request:
https://github.com/apache/beam/pull/3985
[BEAM-2979] Fix a race condition in getWatermark() in KafkaIO.
Two fixes :
- Don't set curRecord to null before updating. If user deserializers
throw, ok to keep curRecord pointing to old one.
- Use atomic references for curRecord and curTimestamp since these are
accessed in getWatermark() and getCurrentTimestamp(). These methods could be
called concurrently with advance().
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/rangadi/beam race_in_kafkaio
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/beam/pull/3985.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #3985
----
commit 70d13ff82ae85dcafa4535d070236e57cde43fc4
Author: Raghu Angadi <[email protected]>
Date: 2017-10-11T22:04:28Z
[BEAM-2979] Fix a race condition in getWatermark() in KafkaIO.
Two fixes :
- Don't set curRecord to null before updating. If user deserializers
throw, ok to keep curRecord pointing to old one.
- use atomic references for curRecord and curTimestamp since
these are accessed in getWatermark() and getCurrentTimestamp().
These methods could be called concurrently with advance().
----
---