ctubbsii commented on code in PR #3134:
URL: https://github.com/apache/accumulo/pull/3134#discussion_r1051491502


##########
test/src/main/java/org/apache/accumulo/test/functional/ThriftMaxFrameSizeIT.java:
##########
@@ -0,0 +1,109 @@
+/*
+ * 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
+ *
+ *   https://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.accumulo.test.functional;
+
+import static org.apache.accumulo.harness.AccumuloITBase.SUNNY_DAY;
+import static 
org.apache.accumulo.test.functional.ConfigurableMacBase.configureForSsl;
+
+import java.time.Duration;
+
+import org.apache.accumulo.core.client.Accumulo;
+import org.apache.accumulo.core.client.AccumuloClient;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.harness.AccumuloClusterHarness;
+import org.apache.accumulo.miniclusterImpl.MiniAccumuloConfigImpl;
+import org.apache.accumulo.server.rpc.ThriftServerType;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.thrift.TConfiguration;
+import org.junit.jupiter.api.Nested;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+
+@Tag(SUNNY_DAY)
+public class ThriftMaxFrameSizeIT extends AccumuloClusterHarness {
+
+  private ThriftServerType serverType;
+
+  @Override
+  protected Duration defaultTimeout() {
+    return Duration.ofMinutes(1);
+  }
+
+  @Override
+  public void configureMiniCluster(MiniAccumuloConfigImpl cfg, Configuration 
hadoopCoreSite) {
+    cfg.setProperty(Property.GENERAL_RPC_SERVER_TYPE, serverType.name());
+    if (serverType == ThriftServerType.SSL) {
+      configureForSsl(cfg,
+          getSslDir(createTestDir(this.getClass().getName() + "_" + 
this.testName())));
+    }
+  }
+
+  @Nested
+  class TestDefault extends TestMaxFrameSize {
+    {
+      serverType = ThriftServerType.getDefault();
+    }

Review Comment:
   Interesting strategy to use nested test classes to affect the behavior of 
the `@BeforeEach` method that sets up the minicluster. I think we have some 
other Thrift tests that could benefit from a similar usage of this. I know 
there's some proxy tests, at least, that I think got moved to accumulo-proxy 
repo... but there might be others still here.
   
   However, I think it's a little confusing to use non-static initializer 
blocks to set the serverType. Can you just change those to explicit no-arg 
constructors instead?



##########
server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java:
##########
@@ -221,7 +223,8 @@ private static ServerAddress 
createThreadedSelectorServer(HostAndPort address,
       long timeBetweenThreadChecks, long maxMessageSize) throws 
TTransportException {
 
     final TNonblockingServerSocket transport =
-        new TNonblockingServerSocket(new InetSocketAddress(address.getHost(), 
address.getPort()));
+        new TNonblockingServerSocket(new InetSocketAddress(address.getHost(), 
address.getPort()), 0,
+            Ints.saturatedCast(maxMessageSize));

Review Comment:
   I didn't know about saturated cast! That's nice. What about the timeout 
value? You're setting that to 0? What's the consequences of that?



##########
test/src/main/java/org/apache/accumulo/test/functional/ThriftMaxFrameSizeIT.java:
##########
@@ -0,0 +1,109 @@
+/*
+ * 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
+ *
+ *   https://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.accumulo.test.functional;
+
+import static org.apache.accumulo.harness.AccumuloITBase.SUNNY_DAY;
+import static 
org.apache.accumulo.test.functional.ConfigurableMacBase.configureForSsl;
+
+import java.time.Duration;
+
+import org.apache.accumulo.core.client.Accumulo;
+import org.apache.accumulo.core.client.AccumuloClient;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.harness.AccumuloClusterHarness;
+import org.apache.accumulo.miniclusterImpl.MiniAccumuloConfigImpl;
+import org.apache.accumulo.server.rpc.ThriftServerType;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.thrift.TConfiguration;
+import org.junit.jupiter.api.Nested;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+
+@Tag(SUNNY_DAY)

Review Comment:
   I wouldn't consider this a SUNNY_DAY test. We don't want to add too many of 
those, because we want to keep those relatively fast, compared to the full IT 
build.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to