TEZ-2257. Fix potential NPEs in TaskReporter. (sseth)
Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/61764323 Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/61764323 Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/61764323 Branch: refs/heads/TEZ-2003 Commit: 61764323798385ec8d8103db2d4dcc24c2ebd1ae Parents: 9316fe6 Author: Siddharth Seth <[email protected]> Authored: Tue Apr 7 12:52:33 2015 -0700 Committer: Siddharth Seth <[email protected]> Committed: Tue Apr 7 12:52:33 2015 -0700 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../main/java/org/apache/tez/runtime/task/TaskReporter.java | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/61764323/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index f7295f2..dc28971 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -266,6 +266,7 @@ TEZ-UI CHANGES (TEZ-8): Release 0.5.4: Unreleased ALL CHANGES: + TEZ-2257. Fix potential NPEs in TaskReporter. TEZ-2192. Relocalization does not check for source. TEZ-2224. EventQueue empty doesn't mean events are consumed in RecoveryService TEZ-2240. Fix toUpperCase/toLowerCase to use Locale.ENGLISH. http://git-wip-us.apache.org/repos/asf/tez/blob/61764323/tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/TaskReporter.java ---------------------------------------------------------------------- diff --git a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/TaskReporter.java b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/TaskReporter.java index 235958f..4c07f5a 100644 --- a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/TaskReporter.java +++ b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/TaskReporter.java @@ -374,16 +374,16 @@ public class TaskReporter { } } - public boolean taskSucceeded(TezTaskAttemptID taskAttemptID) throws IOException, TezException { + public synchronized boolean taskSucceeded(TezTaskAttemptID taskAttemptID) throws IOException, TezException { return currentCallable.taskSucceeded(taskAttemptID); } - public boolean taskFailed(TezTaskAttemptID taskAttemptID, Throwable t, String diagnostics, + public synchronized boolean taskFailed(TezTaskAttemptID taskAttemptID, Throwable t, String diagnostics, EventMetaData srcMeta) throws IOException, TezException { return currentCallable.taskFailed(taskAttemptID, t, diagnostics, srcMeta); } - public void addEvents(TezTaskAttemptID taskAttemptID, Collection<TezEvent> events) { + public synchronized void addEvents(TezTaskAttemptID taskAttemptID, Collection<TezEvent> events) { currentCallable.addEvents(taskAttemptID, events); }
