You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@reef.apache.org by jo...@apache.org on 2015/02/10 09:57:26 UTC
incubator-reef git commit: [REEF-80] ID mismatch bug in
YarnContainerManager#appendByDeleteAndCreate
Repository: incubator-reef
Updated Branches:
refs/heads/master 29c56c8e6 -> 02c0ad592
[REEF-80] ID mismatch bug in YarnContainerManager#appendByDeleteAndCreate
This synchronizes writing to evaluator log and re-throws an exception if
the write fails, instead of swallowing it.
JIRA:
[REEF-80] https://issues.apache.org/jira/browse/REEF-80
Pull Request:
Closes #44
Project: http://git-wip-us.apache.org/repos/asf/incubator-reef/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-reef/commit/02c0ad59
Tree: http://git-wip-us.apache.org/repos/asf/incubator-reef/tree/02c0ad59
Diff: http://git-wip-us.apache.org/repos/asf/incubator-reef/diff/02c0ad59
Branch: refs/heads/master
Commit: 02c0ad592f4f4a5f603c2689880f4859c1794b88
Parents: 29c56c8
Author: yingdachen <yi...@apache.org>
Authored: Sun Jan 4 17:05:11 2015 -0800
Committer: John Yang <jo...@gmail.com>
Committed: Tue Feb 10 17:49:09 2015 +0900
----------------------------------------------------------------------
.../yarn/driver/YarnContainerManager.java | 23 ++++++++++----------
1 file changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/02c0ad59/lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/driver/YarnContainerManager.java
----------------------------------------------------------------------
diff --git a/lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/driver/YarnContainerManager.java b/lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/driver/YarnContainerManager.java
index fc1696e..bd8128b 100644
--- a/lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/driver/YarnContainerManager.java
+++ b/lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/driver/YarnContainerManager.java
@@ -599,7 +599,7 @@ final class YarnContainerManager
.build());
}
- private void writeToEvaluatorLog(final String entry) throws IOException {
+ private synchronized void writeToEvaluatorLog(final String entry) throws IOException {
final org.apache.hadoop.conf.Configuration config = new org.apache.hadoop.conf.Configuration();
config.setBoolean("dfs.support.append", true);
config.setBoolean("dfs.support.broken.append", true);
@@ -612,7 +612,7 @@ final class YarnContainerManager
new BufferedWriter(new OutputStreamWriter(fs.append(path))) :
new BufferedWriter(new OutputStreamWriter(fs.create(path)));
) {
- bw.write(entry);
+ bw.write(entry);
} catch (final IOException e) {
if (appendToLog) {
LOG.log(Level.FINE, "Unable to add an entry to the Evaluator log. Attempting append by delete and recreate", e);
@@ -659,22 +659,23 @@ final class YarnContainerManager
private void logContainerAddition(final String containerId) {
final String entry = ADD_FLAG + containerId + System.lineSeparator();
- try {
- writeToEvaluatorLog(entry);
- } catch (final IOException e) {
- LOG.log(Level.WARNING, "Unable to log the addition of container [" + containerId +
- "] to the container log. Driver restart won't work properly.", e);
- }
+ logContainerChange(entry);
}
private void logContainerRemoval(final String containerId) {
final String entry = REMOVE_FLAG + containerId + System.lineSeparator();
+ logContainerChange(entry);
+ }
+
+ private void logContainerChange(final String entry)
+ {
try {
writeToEvaluatorLog(entry);
} catch (final IOException e) {
- LOG.log(Level.WARNING, "Unable to log the removal of container [" + containerId +
- "] to the container log. Driver restart won't work properly.", e);
+ final String errorMsg = "Unable to log the change of container [" + entry +
+ "] to the container log. Driver restart won't work properly.";
+ LOG.log(Level.WARNING, errorMsg, e);
+ throw new RuntimeException(errorMsg);
}
}
-
}