[jira] [Comment Edited] (FLINK-6130) Consider calling resourceManager#getTerminationFuture() with lock held
[ https://issues.apache.org/jira/browse/FLINK-6130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15973937#comment-15973937 ] mingleizhang edited comment on FLINK-6130 at 4/19/17 2:36 AM: -- [~Zentol] [~till.rohrmann] That makes sense to me now. So, I just have decided that the previous practice {code}Object result = future.value().get();{code} is meaningless as I can not get any useful message from it. Thanks and appreciate it. was (Author: mingleizhang): [~Zentol] [~till.rohrmann] That makes sense to me now. So, I just have decided that the previous practice {code}Object result = future.value().get();{code} is meaningless as I can not any useful message from it. Thanks and appreciate it. > Consider calling resourceManager#getTerminationFuture() with lock held > -- > > Key: FLINK-6130 > URL: https://issues.apache.org/jira/browse/FLINK-6130 > Project: Flink > Issue Type: Bug >Reporter: Ted Yu >Assignee: mingleizhang >Priority: Minor > > In YarnFlinkApplicationMasterRunner#runApplicationMaster() : > {code} > synchronized (lock) { > LOG.info("Starting High Availability Services"); > ... > } > // wait for resource manager to finish > resourceManager.getTerminationFuture().get(); > {code} > resourceManager#getTerminationFuture() is called without holding lock. > We should store the value returned from > resourceManager#getTerminationFuture() inside the synchronized block. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Comment Edited] (FLINK-6130) Consider calling resourceManager#getTerminationFuture() with lock held
[ https://issues.apache.org/jira/browse/FLINK-6130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15972736#comment-15972736 ] mingleizhang edited comment on FLINK-6130 at 4/18/17 2:10 PM: -- [~till.rohrmann] Void ? I see. I would think {code}@GuardedBy("lock){code} might a wrong as well. Could we do a refine like the following ? Change the code {code} @GuardedBy("lock") private ResourceManager resourceManager; {code} to {code} private volatile ResourceManager resourceManager; {code} [~Zentol] FYI. Thanks and appreciate it. was (Author: mingleizhang): [~till.rohrmann] Void ? I see. I would think {code}@GuardedBy("lock){code} might a wrong as well. Could we do a refine like the following ? Change the code {code} @GuardedBy("lock") private ResourceManager resourceManager; {code} to {code} private volatile ResourceManager resourceManager; {code} > Consider calling resourceManager#getTerminationFuture() with lock held > -- > > Key: FLINK-6130 > URL: https://issues.apache.org/jira/browse/FLINK-6130 > Project: Flink > Issue Type: Bug >Reporter: Ted Yu >Assignee: mingleizhang >Priority: Minor > > In YarnFlinkApplicationMasterRunner#runApplicationMaster() : > {code} > synchronized (lock) { > LOG.info("Starting High Availability Services"); > ... > } > // wait for resource manager to finish > resourceManager.getTerminationFuture().get(); > {code} > resourceManager#getTerminationFuture() is called without holding lock. > We should store the value returned from > resourceManager#getTerminationFuture() inside the synchronized block. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Comment Edited] (FLINK-6130) Consider calling resourceManager#getTerminationFuture() with lock held
[ https://issues.apache.org/jira/browse/FLINK-6130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15972647#comment-15972647 ] Chesnay Schepler edited comment on FLINK-6130 at 4/18/17 1:18 PM: -- [~till.rohrmann] Because the resourceManager is annotated with @GuardedBy("lock"). was (Author: zentol): [~till.rohrmann] Because the resourceManager is annotated by @GuardedBy("lock"). > Consider calling resourceManager#getTerminationFuture() with lock held > -- > > Key: FLINK-6130 > URL: https://issues.apache.org/jira/browse/FLINK-6130 > Project: Flink > Issue Type: Bug >Reporter: Ted Yu >Assignee: mingleizhang >Priority: Minor > > In YarnFlinkApplicationMasterRunner#runApplicationMaster() : > {code} > synchronized (lock) { > LOG.info("Starting High Availability Services"); > ... > } > // wait for resource manager to finish > resourceManager.getTerminationFuture().get(); > {code} > resourceManager#getTerminationFuture() is called without holding lock. > We should store the value returned from > resourceManager#getTerminationFuture() inside the synchronized block. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Comment Edited] (FLINK-6130) Consider calling resourceManager#getTerminationFuture() with lock held
[ https://issues.apache.org/jira/browse/FLINK-6130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15970586#comment-15970586 ] mingleizhang edited comment on FLINK-6130 at 4/17/17 1:51 AM: -- [~tedyu] Could you please help review the code ? How do you think of this ? Thanks. {code} Future future; synchronized (lock) { // wait for resource manager to finish future = (Future) resourceManager.getTerminationFuture(); } Object object = future.get(); // everything started, we can wait until all is done or the process is killed LOG.info("YARN Application Master finished" + object.toString()); {code} was (Author: mingleizhang): [~tedyu] Could you please help review the code ? How do you think of this ? Thanks. {code} Future future; synchronized (lock) { // wait for resource manager to finish future = (Future) resourceManager.getTerminationFuture(); } Object object = future.get(); // everything started, we can wait until all is done or the process is killed LOG.info("YARN Application Master finished" + object.toString()); {code} > Consider calling resourceManager#getTerminationFuture() with lock held > -- > > Key: FLINK-6130 > URL: https://issues.apache.org/jira/browse/FLINK-6130 > Project: Flink > Issue Type: Bug >Reporter: Ted Yu >Assignee: mingleizhang >Priority: Minor > > In YarnFlinkApplicationMasterRunner#runApplicationMaster() : > {code} > synchronized (lock) { > LOG.info("Starting High Availability Services"); > ... > } > // wait for resource manager to finish > resourceManager.getTerminationFuture().get(); > {code} > resourceManager#getTerminationFuture() is called without holding lock. > We should store the value returned from > resourceManager#getTerminationFuture() inside the synchronized block. -- This message was sent by Atlassian JIRA (v6.3.15#6346)