You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by tillrohrmann <gi...@git.apache.org> on 2015/04/27 14:46:29 UTC
[GitHub] flink pull request: [FLINK-1922] Fixes NPE when TM receives a null...
GitHub user tillrohrmann opened a pull request:
https://github.com/apache/flink/pull/631
[FLINK-1922] Fixes NPE when TM receives a null input split
The ```TaskInputSplitProvider``` did not handle null input splits which are wrapped into a ```NextInputSplit``` message properly. Fixed this.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tillrohrmann/flink fixInputSplit
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/631.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #631
----
commit dad90438f7508309122611f5d79ee9295d242a6f
Author: Till Rohrmann <tr...@apache.org>
Date: 2015-04-27T12:30:16Z
[FLINK-1922] [runtime] Fixes NPE when TM receives a null input split
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request: [FLINK-1922] Fixes NPE when TM receives a null...
Posted by tillrohrmann <gi...@git.apache.org>.
Github user tillrohrmann commented on the pull request:
https://github.com/apache/flink/pull/631#issuecomment-97172343
Thanks for fixing this.
On Tue, Apr 28, 2015 at 8:21 PM, Stephan Ewen <no...@github.com>
wrote:
> I'll fix this and merge the pull request...
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/apache/flink/pull/631#issuecomment-97161402>.
>
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request: [FLINK-1922] Fixes NPE when TM receives a null...
Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on a diff in the pull request:
https://github.com/apache/flink/pull/631#discussion_r29262910
--- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskInputSplitProviderTest.java ---
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.taskmanager;
+
+import akka.actor.ActorRef;
+import akka.actor.ActorSystem;
+import akka.actor.Props;
+import akka.actor.Status;
+import akka.actor.UntypedActor;
+import akka.testkit.JavaTestKit;
+import akka.util.Timeout;
+import org.apache.flink.api.common.JobID;
+import org.apache.flink.core.io.InputSplit;
+import org.apache.flink.runtime.executiongraph.ExecutionAttemptID;
+import org.apache.flink.runtime.jobgraph.JobVertexID;
+import org.apache.flink.runtime.messages.JobManagerMessages;
+import org.apache.flink.runtime.testingUtils.TestingUtils;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import java.util.concurrent.TimeUnit;
+
+public class TaskInputSplitProviderTest {
+
+ private static ActorSystem system;
+
+ @BeforeClass
+ public static void setup() throws Exception {
+ system = ActorSystem.create("TestActorSystem", TestingUtils.testConfig());
+ }
+
+ @AfterClass
+ public static void teardown() throws Exception {
+ JavaTestKit.shutdownActorSystem(system);
+ system = null;
+ }
+
+ @Test
+ public void testRequestNextInputSplitWithInvalidExecutionID() {
+
+ final JobID jobID = new JobID();
+ final JobVertexID vertexID = new JobVertexID();
+ final ExecutionAttemptID executionID = new ExecutionAttemptID();
+ final Timeout timeout = new Timeout(10, TimeUnit.SECONDS);
+
+ final ActorRef jobManagerRef = system.actorOf(Props.create(NullInputSplitJobManager.class));
+
+ final TaskInputSplitProvider provider = new TaskInputSplitProvider(
+ jobManagerRef,
+ jobID,
+ vertexID,
+ executionID,
+ Thread.currentThread().getContextClassLoader(),
--- End diff --
This is probably `null`, no? The default classloader can be grabbed either via. `Classloader.getSystemClassloader()` or here via `getClass().getClassloader()`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request: [FLINK-1922] Fixes NPE when TM receives a null...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/flink/pull/631
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request: [FLINK-1922] Fixes NPE when TM receives a null...
Posted by hsaputra <gi...@git.apache.org>.
Github user hsaputra commented on a diff in the pull request:
https://github.com/apache/flink/pull/631#discussion_r29268270
--- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskInputSplitProviderTest.java ---
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.taskmanager;
+
+import akka.actor.ActorRef;
+import akka.actor.ActorSystem;
+import akka.actor.Props;
+import akka.actor.Status;
+import akka.actor.UntypedActor;
+import akka.testkit.JavaTestKit;
+import akka.util.Timeout;
+import org.apache.flink.api.common.JobID;
+import org.apache.flink.core.io.InputSplit;
+import org.apache.flink.runtime.executiongraph.ExecutionAttemptID;
+import org.apache.flink.runtime.jobgraph.JobVertexID;
+import org.apache.flink.runtime.messages.JobManagerMessages;
+import org.apache.flink.runtime.testingUtils.TestingUtils;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import java.util.concurrent.TimeUnit;
+
+public class TaskInputSplitProviderTest {
+
+ private static ActorSystem system;
+
+ @BeforeClass
+ public static void setup() throws Exception {
+ system = ActorSystem.create("TestActorSystem", TestingUtils.testConfig());
+ }
+
+ @AfterClass
+ public static void teardown() throws Exception {
+ JavaTestKit.shutdownActorSystem(system);
+ system = null;
+ }
+
+ @Test
+ public void testRequestNextInputSplitWithInvalidExecutionID() {
+
+ final JobID jobID = new JobID();
+ final JobVertexID vertexID = new JobVertexID();
+ final ExecutionAttemptID executionID = new ExecutionAttemptID();
+ final Timeout timeout = new Timeout(10, TimeUnit.SECONDS);
+
+ final ActorRef jobManagerRef = system.actorOf(Props.create(NullInputSplitJobManager.class));
+
+ final TaskInputSplitProvider provider = new TaskInputSplitProvider(
+ jobManagerRef,
+ jobID,
+ vertexID,
+ executionID,
+ Thread.currentThread().getContextClassLoader(),
--- End diff --
This could be null. Would probably better to grab class loader via getClass I suppose.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request: [FLINK-1922] Fixes NPE when TM receives a null...
Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the pull request:
https://github.com/apache/flink/pull/631#issuecomment-97161402
I'll fix this and merge the pull request...
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---