beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aviem Zur (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BEAM-1950) Access to static field shouldn't be protected by lock on non-static MicrobatchSource.this
Date Wed, 12 Apr 2017 17:25:41 GMT

    [ https://issues.apache.org/jira/browse/BEAM-1950?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15966246#comment-15966246
] 

Aviem Zur commented on BEAM-1950:
---------------------------------

Yes. {{initReaderCache}} should be marked static.

> 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)

Mime
View raw message