flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Till Rohrmann (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (FLINK-9784) Inconsistent use of 'static' in AsyncIOExample.java
Date Thu, 12 Jul 2018 11:46:00 GMT

     [ https://issues.apache.org/jira/browse/FLINK-9784?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Till Rohrmann resolved FLINK-9784.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 1.6.0
                   1.5.2

Fixed via 
1.6.0: 5363595d588d7a20840e5caef2373ba3b62cb662
1.5.2: 93170091155f9f766f1bfa8e54085bd6c70be525

> Inconsistent use of 'static' in AsyncIOExample.java
> ---------------------------------------------------
>
>                 Key: FLINK-9784
>                 URL: https://issues.apache.org/jira/browse/FLINK-9784
>             Project: Flink
>          Issue Type: Bug
>          Components: Examples
>    Affects Versions: 1.5.0, 1.4.2
>            Reporter: Alexei Nekrassov
>            Assignee: Alexei Nekrassov
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.5.2, 1.6.0
>
>
> In SampleAsyncFunction having _executorService_ and _random_ as static, but _counter_
as instance-specific will not work when someone creates a second instance of SampleAsyncFunction.
In second SampleAsyncFunction the _counter_ will be 0 and we will re-intialize static _executorService_
and _random_, thus interfering with the first SampleAsyncFunction object.
> To fix this example and make it clearer, make _executorService_ and _random_ instance-specific.
That will make _counter_ redundant; also synchronization on class will no longer be needed.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message