[
https://issues.apache.org/jira/browse/BEAM-1950?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15966268#comment-15966268
]
ASF GitHub Bot commented on BEAM-1950:
--------------------------------------
GitHub user aviemzur opened a pull request:
https://github.com/apache/beam/pull/2514
[BEAM-1950] Add missing 'static' keyword to MicrobatchSource#initReaderCache
Be sure to do all of the following to help us incorporate your contribution
quickly and easily:
- [ ] Make sure the PR title is formatted like:
`[BEAM-<Jira issue #>] Description of pull request`
- [ ] Make sure tests pass via `mvn clean verify`. (Even better, enable
Travis-CI on your fork and ensure the whole test matrix passes).
- [ ] Replace `<Jira issue #>` in the title with the actual Jira issue
number, if there is one.
- [ ] If this contribution is large, please file an Apache
[Individual Contributor License
Agreement](https://www.apache.org/licenses/icla.pdf).
---
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/aviemzur/beam
fix-microbatchsource-readercache-lock
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/beam/pull/2514.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 #2514
----
commit 5751c0df58a747acc9c6138dfeef45fcb5dc9ec2
Author: Aviem Zur <[email protected]>
Date: 2017-04-12T17:41:11Z
[BEAM-1950] Add missing 'static' keyword to MicrobatchSource#initReaderCache
----
> Access to static field shouldn't be protected by lock on non-static
> MicrobatchSource.this
> -----------------------------------------------------------------------------------------
>
> Key: BEAM-1950
> URL: https://issues.apache.org/jira/browse/BEAM-1950
> Project: Beam
> Issue Type: Bug
> Components: runner-spark
> Reporter: Ted Yu
> Assignee: Amit Sela
> Priority: Minor
>
> In MicrobatchSource :
> {code}
> private synchronized void initReaderCache(long readerCacheInterval) {
> if (readerCache == null) {
> LOG.info("Creating reader cache. Cache interval = " +
> readerCacheInterval + " ms.");
> readerCache =
> CacheBuilder.newBuilder()
> {code}
> readerCache is static.
> Access to readerCache shouldn't be protected by lock on non-static
> MicrobatchSource.this
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)