[ 
https://issues.apache.org/jira/browse/DRILL-6255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16477123#comment-16477123
 ] 

ASF GitHub Bot commented on DRILL-6255:
---------------------------------------

arina-ielchiieva commented on a change in pull request #1253: DRILL-6255: 
Drillbit while sending control message to itself creates …
URL: https://github.com/apache/drill/pull/1253#discussion_r188553012
 
 

 ##########
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/rpc/control/TestLocalControlConnectionManager.java
 ##########
 @@ -0,0 +1,278 @@
+/*
+ * 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.drill.exec.rpc.control;
+
+import io.netty.buffer.ByteBuf;
+import org.apache.drill.exec.proto.BitControl;
+import org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint;
+import org.apache.drill.exec.proto.ExecProtos;
+import org.apache.drill.exec.proto.GeneralRPCProtos;
+import org.apache.drill.exec.proto.UserBitShared;
+import org.apache.drill.exec.rpc.Acks;
+import org.apache.drill.exec.rpc.RpcException;
+import org.apache.drill.exec.rpc.RpcOutcomeListener;
+import org.apache.drill.exec.work.batch.ControlMessageHandler;
+import org.hamcrest.Description;
+import org.hamcrest.TypeSafeMatcher;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import java.util.concurrent.CountDownLatch;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public class TestLocalControlConnectionManager {
+
+  private static final DrillbitEndpoint localEndpoint = 
DrillbitEndpoint.newBuilder()
+    .setAddress("10.0.0.1")
+    .setControlPort(31011)
+    .setState(DrillbitEndpoint.State.STARTUP)
+    .build();
+
+  private static ControlConnectionConfig mockConfig;
+
+  private static ControlMessageHandler mockHandler;
+
+  private static ControlTunnel controlTunnel;
+
+  private CountDownLatch latch;
+
+  private final String negativeAckMessage = "Negative Ack received";
 
 Review comment:
   static

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Drillbit while sending control message to itself creates a connection instead 
> of submitting locally
> ---------------------------------------------------------------------------------------------------
>
>                 Key: DRILL-6255
>                 URL: https://issues.apache.org/jira/browse/DRILL-6255
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Flow
>    Affects Versions: 1.12.0
>            Reporter: Sorabh Hamirwasia
>            Assignee: Sorabh Hamirwasia
>            Priority: Major
>             Fix For: 1.14.0
>
>
> With the new shutdown feature introduced in 1.12, there is a state introduced 
> in DrillbitEndpoint. Due to this the equality check happening 
> [here|https://github.com/apache/drill/blob/master/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/FragmentsRunner.java#L256]
>  will result in false and hence the fragments supposed to be scheduled on 
> Foreman will be treated as remote fragments and a connection will be created 
> to schedule it. The equality check is false because localEndpoint state is 
> STARTUP whereas state in assigned Drillbit is ONLINE.
> I guess now we should update the equality check to verify just for address 
> and control port to be same between assigned and local Drillbit endpoint. A 
> test can be added for this based on _sys.memory_ table since that guarantees 
> scheduling minor fragments on each Drillbit node.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to