You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "rwelgosh (via GitHub)" <gi...@apache.org> on 2024/06/11 22:43:04 UTC
[PR] CASSANDRASC-135: Added additional JVM options to increase max open FD limit for MacOS [cassandra-sidecar]
rwelgosh opened a new pull request, #126:
URL: https://github.com/apache/cassandra-sidecar/pull/126
Patch by Raymond Welgosh; Reviewed by Francisco Guerrero, Yifan Cai for CASSANDRASC-135
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRASC-135: Added additional JVM options to increase max open FD limit for MacOS [cassandra-sidecar]
Posted by "frankgh (via GitHub)" <gi...@apache.org>.
frankgh commented on code in PR #126:
URL: https://github.com/apache/cassandra-sidecar/pull/126#discussion_r1635567453
##########
gradlew:
##########
@@ -105,8 +105,10 @@ if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
fi
# For Darwin, add options to specify how the application appears in the dock
+# In addition, we want to disable the MaxFDLimit for MacOS, which is set to a lower limit than the actual system maximum.
Review Comment:
```suggestion
# In addition, we want to increase the file descriptor limit to the MaxFDLimit in MacOS which, by default, is set to a lower limit than the actual system's maximum.
```
##########
vertx-client-shaded/build.gradle:
##########
@@ -83,6 +83,8 @@ shadowJar {
}
}
+test.dependsOn shadowJar
Review Comment:
thanks for fixing this dependency! I have a small NIT:
```suggestion
tasks.named('test') {
dependsOn 'shadowJar'
}
```
##########
src/test/java/org/apache/cassandra/sidecar/UlimitTest.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * 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.cassandra.sidecar;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class UlimitTest
+{
+ @Test
+ void ensureUlimitMaxFilesIsNotTooLow() throws Exception
+ {
+ Process p = new ProcessBuilder("ulimit", "-n").start();
+ p.waitFor();
+ InputStreamReader inputStreamReader = new InputStreamReader(p.getInputStream());
+ BufferedReader reader = new BufferedReader(inputStreamReader);
+ String line = reader.readLine();
+ long maxFD = Long.parseLong(line);
+ System.out.println(maxFD);
+ assertThat(maxFD).isGreaterThan(10240);
Review Comment:
will this always be true? also, can we scope this test to macOS ?
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRASC-135: Added additional JVM options to increase max open FD limit for MacOS [cassandra-sidecar]
Posted by "yifan-c (via GitHub)" <gi...@apache.org>.
yifan-c commented on code in PR #126:
URL: https://github.com/apache/cassandra-sidecar/pull/126#discussion_r1639015225
##########
src/test/java/org/apache/cassandra/sidecar/UlimitTest.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * 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.cassandra.sidecar;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
+
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * Test to ensure that the max file descriptors is large enough to build Cassandra Sidecar
+ */
+@Disabled("ulimit does not exist at the CI runtime")
+public class UlimitTest
Review Comment:
Some annotations in junit5 are amazing!
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRASC-135: Added additional JVM options to increase max open FD limit for MacOS [cassandra-sidecar]
Posted by "yifan-c (via GitHub)" <gi...@apache.org>.
yifan-c commented on code in PR #126:
URL: https://github.com/apache/cassandra-sidecar/pull/126#discussion_r1636778653
##########
gradlew:
##########
@@ -105,8 +105,10 @@ if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
fi
# For Darwin, add options to specify how the application appears in the dock
+# In addition, we want to disable the MaxFDLimit for MacOS, which is set to a lower limit than the actual system maximum.
Review Comment:
No. The max FD constant for macOS is low. It is `OPEN_MAX == 10240` https://github.com/openjdk/jdk/blob/dfd3da3f52480f68f653beb1e720691f8232ace7/src/hotspot/os/bsd/os_bsd.cpp#L1997-L2002
You want to _disable_ the max FD, so that it can pick up the system's limit.
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRASC-135: Added additional JVM options to increase max open FD limit for MacOS [cassandra-sidecar]
Posted by "yifan-c (via GitHub)" <gi...@apache.org>.
yifan-c merged PR #126:
URL: https://github.com/apache/cassandra-sidecar/pull/126
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRASC-135: Added additional JVM options to increase max open FD limit for MacOS [cassandra-sidecar]
Posted by "bbotella (via GitHub)" <gi...@apache.org>.
bbotella commented on code in PR #126:
URL: https://github.com/apache/cassandra-sidecar/pull/126#discussion_r1635567742
##########
vertx-client-shaded/build.gradle:
##########
@@ -83,6 +83,8 @@ shadowJar {
}
}
+test.dependsOn shadowJar
Review Comment:
I'm curious. Why does it need the shadow jar now but didn't before?
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRASC-135: Added additional JVM options to increase max open FD limit for MacOS [cassandra-sidecar]
Posted by "yifan-c (via GitHub)" <gi...@apache.org>.
yifan-c commented on code in PR #126:
URL: https://github.com/apache/cassandra-sidecar/pull/126#discussion_r1635597079
##########
gradlew:
##########
@@ -105,8 +105,10 @@ if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
fi
# For Darwin, add options to specify how the application appears in the dock
+# In addition, we want to disable the MaxFDLimit for MacOS, which is set to a lower limit than the actual system maximum.
Review Comment:
To clarify, the JVM option `-XX:-MaxFDLimit` is to _disable_ the low `MaxFDLimit` set in JDK. By disabling, it can pick up the system FD limit, which is larger and proper.
The suggested sentence looks incorrect.
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRASC-135: Added additional JVM options to increase max open FD limit for MacOS [cassandra-sidecar]
Posted by "yifan-c (via GitHub)" <gi...@apache.org>.
yifan-c commented on code in PR #126:
URL: https://github.com/apache/cassandra-sidecar/pull/126#discussion_r1635601847
##########
vertx-client-shaded/build.gradle:
##########
@@ -83,6 +83,8 @@ shadowJar {
}
}
+test.dependsOn shadowJar
Review Comment:
```
LibraryTest > Ensures that the shading is correct for the vertx-client-shaded project FAILED
```
It is to fix the flaky test, `LibraryTest`. The test requires shadow jar being built. However, when the test runs, the jar is empty.
That being said, test already depends on shadowJar. It needs a different fix.
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRASC-135: Added additional JVM options to increase max open FD limit for MacOS [cassandra-sidecar]
Posted by "frankgh (via GitHub)" <gi...@apache.org>.
frankgh commented on code in PR #126:
URL: https://github.com/apache/cassandra-sidecar/pull/126#discussion_r1635836629
##########
gradlew:
##########
@@ -105,8 +105,10 @@ if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
fi
# For Darwin, add options to specify how the application appears in the dock
+# In addition, we want to disable the MaxFDLimit for MacOS, which is set to a lower limit than the actual system maximum.
Review Comment:
I noticed there are places where we enable the flag, and other places where we disable the flag. Is that intentional?
Reading this documentation: https://docs.oracle.com/cd/E19683-01/806-7930/filestructure-11/index.html it looks like setting the flag i.e. doing `-XX:+MaxFDLimit` should `Bump the number of file descriptors to max`. Isn't this what we are trying to accomplish here?
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRASC-135: Added additional JVM options to increase max open FD limit for MacOS [cassandra-sidecar]
Posted by "yifan-c (via GitHub)" <gi...@apache.org>.
yifan-c commented on code in PR #126:
URL: https://github.com/apache/cassandra-sidecar/pull/126#discussion_r1635562381
##########
.java-version:
##########
@@ -0,0 +1 @@
+graalvm64-11.0.20
Review Comment:
we need to exclude this file and add a new entry to gitignore.
The file is produced by `jenv`
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRASC-135: Added additional JVM options to increase max open FD limit for MacOS [cassandra-sidecar]
Posted by "frankgh (via GitHub)" <gi...@apache.org>.
frankgh commented on code in PR #126:
URL: https://github.com/apache/cassandra-sidecar/pull/126#discussion_r1637226497
##########
src/test/java/org/apache/cassandra/sidecar/UlimitTest.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * 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.cassandra.sidecar;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
+
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * Test to ensure that the max file descriptors is large enough to build Cassandra Sidecar
+ */
+@Disabled("ulimit does not exist at the CI runtime")
+public class UlimitTest
Review Comment:
can we instead try annotating the test with `@EnabledOnOs({OS.MAC})`?
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRASC-135: Added additional JVM options to increase max open FD limit for MacOS [cassandra-sidecar]
Posted by "yifan-c (via GitHub)" <gi...@apache.org>.
yifan-c commented on code in PR #126:
URL: https://github.com/apache/cassandra-sidecar/pull/126#discussion_r1636779601
##########
client-common/build.gradle:
##########
@@ -41,6 +44,9 @@ repositories {
test {
useJUnitPlatform()
+ if (Os.isFamily(Os.FAMILY_MAC)) {
+ jvmArgs "-XX:+MaxFDLimit"
Review Comment:
disable. use `'-XX:-MaxFDLimit` instead.
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org