You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by se...@apache.org on 2014/11/04 12:33:42 UTC
[2/3] git commit: [FLINK-1198] Fix nullpointer exception in broadcast
variable materialization
[FLINK-1198] Fix nullpointer exception in broadcast variable materialization
Project: http://git-wip-us.apache.org/repos/asf/incubator-flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-flink/commit/7d2db95a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-flink/tree/7d2db95a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-flink/diff/7d2db95a
Branch: refs/heads/master
Commit: 7d2db95ad3661663f9f33749717f81ec7f0fae7b
Parents: e1fd689
Author: Stephan Ewen <se...@apache.org>
Authored: Tue Nov 4 11:30:21 2014 +0100
Committer: Stephan Ewen <se...@apache.org>
Committed: Tue Nov 4 11:31:16 2014 +0100
----------------------------------------------------------------------
.../flink/runtime/broadcast/BroadcastVariableManager.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/7d2db95a/flink-runtime/src/main/java/org/apache/flink/runtime/broadcast/BroadcastVariableManager.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/broadcast/BroadcastVariableManager.java b/flink-runtime/src/main/java/org/apache/flink/runtime/broadcast/BroadcastVariableManager.java
index d3bf7a6..92acdde 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/broadcast/BroadcastVariableManager.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/broadcast/BroadcastVariableManager.java
@@ -54,7 +54,14 @@ public class BroadcastVariableManager {
// concurrent release. as an optimization, try to replace the previous one with our version. otherwise we might spin for a while
// until the releaser removes the variable
// NOTE: This would also catch a bug prevented an expired materialization from ever being removed, so it acts as a future safeguard
- if (variables.replace(key, previous, newMat)) {
+
+ boolean replaceSuccessful = false;
+ try {
+ replaceSuccessful = variables.replace(key, materialization, newMat);
+ }
+ catch (Throwable t) {}
+
+ if (replaceSuccessful) {
try {
newMat.materializeVariable(reader, serializerFactory, holder);
return newMat;