You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/03/19 15:50:43 UTC

[GitHub] [lucene-solr] janhoy opened a new pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping

janhoy opened a new pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping
URL: https://github.com/apache/lucene-solr/pull/1364
 
 
   See https://issues.apache.org/jira/browse/SOLR-14335
   Goal of this PR is to start Solr with a custom bootstrap class, which delegates to Jetty's main. In the custom bootstrap class, we will then implement memroy locking through JNA

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] janhoy commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping

Posted by GitBox <gi...@apache.org>.
janhoy commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping
URL: https://github.com/apache/lucene-solr/pull/1364#discussion_r396327177
 
 

 ##########
 File path: solr/bootstrap/src/java/org/apache/solr/bootstrap/NativeLibrary.java
 ##########
 @@ -0,0 +1,139 @@
+/*
+ * 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.solr.bootstrap;
+
+import com.sun.jna.LastErrorException;
+import org.eclipse.jetty.start.StartLog;
+
+import static org.apache.solr.bootstrap.NativeLibrary.OSType.*;
+
+public final class NativeLibrary {
+  public enum OSType {
+    LINUX,
+    MAC,
+    WINDOWS,
+    AIX,
+    OTHER;
+  }
+
+  public static final OSType osType;
+
+  private static final int MCL_CURRENT;
+
+  private static final int ENOMEM = 12;
+
+  private static final NativeLibraryWrapper wrappedLibrary;
+  private static boolean jnaLockable = false;
+
+  static {
+    // detect the OS type the JVM is running on and then set the CLibraryWrapper
+    // instance to a compatable implementation of CLibraryWrapper for that OS type
+    osType = getOsType();
+    switch (osType) {
+      case MAC:
+        wrappedLibrary = new NativeLibraryDarwin();
+        break;
+      case WINDOWS:
+        wrappedLibrary = new NativeLibraryWindows();
+        break;
+      case LINUX:
+      case AIX:
+      case OTHER:
+      default:
+        wrappedLibrary = new NativeLibraryLinux();
+    }
+
+    if (System.getProperty("os.arch").toLowerCase().contains("ppc")) {
+      if (osType == LINUX) {
+        MCL_CURRENT = 0x2000;
+      } else if (osType == AIX) {
+        MCL_CURRENT = 0x100;
+      } else {
+        MCL_CURRENT = 1;
+      }
+    } else {
+      MCL_CURRENT = 1;
+    }
+  }
+
+  private NativeLibrary() {
+  }
+
+  /**
+   * @return the detected OSType of the Operating System running the JVM using crude string matching
+   */
+  private static OSType getOsType() {
 
 Review comment:
   This module runs before Lucene's classpath has been established, so does not have access to any of that. That's why we cannot even log with slf4j.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping
URL: https://github.com/apache/lucene-solr/pull/1364#discussion_r395140443
 
 

 ##########
 File path: solr/server/build.gradle
 ##########
 @@ -111,7 +112,12 @@ task assemblePackaging(type: Sync) {
     into "lib/ext"
   })
 
-  from { project.configurations.startJar.singleFile } {
+  from("${buildDir}/libs", {
 
 Review comment:
   I think a new module would make more sense (put a comment in jira).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] janhoy commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping

Posted by GitBox <gi...@apache.org>.
janhoy commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping
URL: https://github.com/apache/lucene-solr/pull/1364#discussion_r395138580
 
 

 ##########
 File path: solr/server/build.gradle
 ##########
 @@ -111,7 +112,12 @@ task assemblePackaging(type: Sync) {
     into "lib/ext"
   })
 
-  from { project.configurations.startJar.singleFile } {
+  from("${buildDir}/libs", {
 
 Review comment:
   It's just a hack so far to get it building. I thought the bootstrap class belongs in server module, but there is probably a better way to copy the lib in place. Or we could have a completely new solr/bootstrap module with its own build file just to produce solr.jar?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] janhoy commented on issue #1364: SOLR-14335: Lock Solr's memory to prevent swapping

Posted by GitBox <gi...@apache.org>.
janhoy commented on issue #1364: SOLR-14335: Lock Solr's memory to prevent swapping
URL: https://github.com/apache/lucene-solr/pull/1364#issuecomment-601670345
 
 
   I updated to have a separate `bootstrap` module, only generating a `solr.jar` witha single class in it. Also the MANIFEST now specifies main class and classpath, so you can run `java -jar solr.jar --module=http` and it will start Solr.
   
   This is still gradle only, so `ant server && bin/solr start` will not work...

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping
URL: https://github.com/apache/lucene-solr/pull/1364#discussion_r396321964
 
 

 ##########
 File path: solr/bootstrap/src/java/org/apache/solr/bootstrap/SolrBootstrap.java
 ##########
 @@ -0,0 +1,51 @@
+/*
+ * 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.solr.bootstrap;
+
+import org.eclipse.jetty.start.StartLog;
+
+/**
+ * Main class that will delegate to Jetty's Main class after doing some bootstrap actions.
+ * Everything that needs to be done before the Jetty application starts can go here.
+ */
+public class SolrBootstrap {
+  static {
+    System.setProperty("jna.tmpdir", System.getProperty("solr.solr.home"));
+  }
+
+  public SolrBootstrap() {
+    StartLog.info("Starting Solr...");
+  }
+
+  public static void main(String[] args) {
+    SolrBootstrap solrBootstrap = new SolrBootstrap();
+    solrBootstrap.memLockMaybe();
+    org.eclipse.jetty.start.Main.main(args);
+  }
+
+  private void memLockMaybe() {
+    if (Boolean.getBoolean("solr.memory.lock")) {
+      if (NativeLibrary.isAvailable()) {
+        StartLog.info("Attempting to lock Solr's memory to prevent swapping...");
+        NativeLibrary.tryMlockall();
+      } else {
+        StartLog.debug("JNA not available, cannot lock memory");
 
 Review comment:
   This should also be "warn" has it is a bad idea to not tell the user that it does not work at all. If user wants to get rid of warning, he should disable the solr.memory.lock sysprop (resp. env var) from startfile.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] janhoy commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping

Posted by GitBox <gi...@apache.org>.
janhoy commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping
URL: https://github.com/apache/lucene-solr/pull/1364#discussion_r396398754
 
 

 ##########
 File path: solr/bootstrap/build.gradle
 ##########
 @@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+
+apply plugin: 'java-library'
+
+jar {
+  manifest {
+    attributes(
+            'Main-Class': 'org.apache.solr.bootstrap.SolrBootstrap',
+            'Class-Path': '. lib/start.jar jna.jar'
 
 Review comment:
   I tried this, but got
   
   > * What went wrong:
   > A problem occurred evaluating project ':solr:bootstrap'.
   > > Not allowed to resolve configuration ':solr:bootstrap:runtimeClasspath' at configuration time (https://guides.gradle.org/performance/#don_t_resolve_dependencies_at_configuration_time). Please upgrade your plugins and double-check your gradle scripts (see stacktrace)
   > 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping
URL: https://github.com/apache/lucene-solr/pull/1364#discussion_r396389388
 
 

 ##########
 File path: solr/bootstrap/build.gradle
 ##########
 @@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+
+apply plugin: 'java-library'
+
+jar {
+  manifest {
+    attributes(
+            'Main-Class': 'org.apache.solr.bootstrap.SolrBootstrap',
+            'Class-Path': '. lib/start.jar jna.jar'
 
 Review comment:
   This is a chance to clean up manual jar naming, actually. The classpath here should be something like this:
   "Class-Path": configurations.runtimeClasspath.collect { "lib/${it.getName()}" }.join(' '))
   then bootstrap would have accurate coordinates at the exact library versions it needs to launch. Plus -- the "rename" trickery wouldn't be needed anymore in server.gradle.
   
   The name of the output artifact (bootstrap.jar) can be set in this project as well (so that it doesn't have a version in the name). 
   jar.archiveName = "boostrap.jar"
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping
URL: https://github.com/apache/lucene-solr/pull/1364#discussion_r396331814
 
 

 ##########
 File path: solr/bootstrap/src/java/org/apache/solr/bootstrap/NativeLibrary.java
 ##########
 @@ -0,0 +1,139 @@
+/*
+ * 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.solr.bootstrap;
+
+import com.sun.jna.LastErrorException;
+import org.eclipse.jetty.start.StartLog;
+
+import static org.apache.solr.bootstrap.NativeLibrary.OSType.*;
+
+public final class NativeLibrary {
+  public enum OSType {
+    LINUX,
+    MAC,
+    WINDOWS,
+    AIX,
+    OTHER;
+  }
+
+  public static final OSType osType;
+
+  private static final int MCL_CURRENT;
+
+  private static final int ENOMEM = 12;
+
+  private static final NativeLibraryWrapper wrappedLibrary;
+  private static boolean jnaLockable = false;
+
+  static {
+    // detect the OS type the JVM is running on and then set the CLibraryWrapper
+    // instance to a compatable implementation of CLibraryWrapper for that OS type
+    osType = getOsType();
+    switch (osType) {
+      case MAC:
+        wrappedLibrary = new NativeLibraryDarwin();
+        break;
+      case WINDOWS:
+        wrappedLibrary = new NativeLibraryWindows();
+        break;
+      case LINUX:
+      case AIX:
+      case OTHER:
+      default:
+        wrappedLibrary = new NativeLibraryLinux();
+    }
+
+    if (System.getProperty("os.arch").toLowerCase().contains("ppc")) {
+      if (osType == LINUX) {
+        MCL_CURRENT = 0x2000;
+      } else if (osType == AIX) {
+        MCL_CURRENT = 0x100;
+      } else {
+        MCL_CURRENT = 1;
+      }
+    } else {
+      MCL_CURRENT = 1;
+    }
+  }
+
+  private NativeLibrary() {
+  }
+
+  /**
+   * @return the detected OSType of the Operating System running the JVM using crude string matching
+   */
+  private static OSType getOsType() {
 
 Review comment:
   Ah right!

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] janhoy commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping

Posted by GitBox <gi...@apache.org>.
janhoy commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping
URL: https://github.com/apache/lucene-solr/pull/1364#discussion_r396327377
 
 

 ##########
 File path: solr/bootstrap/src/java/org/apache/solr/bootstrap/SolrBootstrap.java
 ##########
 @@ -0,0 +1,51 @@
+/*
+ * 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.solr.bootstrap;
+
+import org.eclipse.jetty.start.StartLog;
+
+/**
+ * Main class that will delegate to Jetty's Main class after doing some bootstrap actions.
+ * Everything that needs to be done before the Jetty application starts can go here.
+ */
+public class SolrBootstrap {
+  static {
+    System.setProperty("jna.tmpdir", System.getProperty("solr.solr.home"));
+  }
+
+  public SolrBootstrap() {
+    StartLog.info("Starting Solr...");
+  }
+
+  public static void main(String[] args) {
+    SolrBootstrap solrBootstrap = new SolrBootstrap();
+    solrBootstrap.memLockMaybe();
+    org.eclipse.jetty.start.Main.main(args);
+  }
+
+  private void memLockMaybe() {
+    if (Boolean.getBoolean("solr.memory.lock")) {
+      if (NativeLibrary.isAvailable()) {
+        StartLog.info("Attempting to lock Solr's memory to prevent swapping...");
+        NativeLibrary.tryMlockall();
+      } else {
+        StartLog.debug("JNA not available, cannot lock memory");
 
 Review comment:
   Agree

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping
URL: https://github.com/apache/lucene-solr/pull/1364#discussion_r396320238
 
 

 ##########
 File path: solr/bootstrap/src/java/org/apache/solr/bootstrap/NativeLibrary.java
 ##########
 @@ -0,0 +1,139 @@
+/*
+ * 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.solr.bootstrap;
+
+import com.sun.jna.LastErrorException;
+import org.eclipse.jetty.start.StartLog;
+
+import static org.apache.solr.bootstrap.NativeLibrary.OSType.*;
+
+public final class NativeLibrary {
+  public enum OSType {
+    LINUX,
+    MAC,
+    WINDOWS,
+    AIX,
+    OTHER;
+  }
+
+  public static final OSType osType;
+
+  private static final int MCL_CURRENT;
+
+  private static final int ENOMEM = 12;
+
+  private static final NativeLibraryWrapper wrappedLibrary;
+  private static boolean jnaLockable = false;
+
+  static {
+    // detect the OS type the JVM is running on and then set the CLibraryWrapper
+    // instance to a compatable implementation of CLibraryWrapper for that OS type
+    osType = getOsType();
+    switch (osType) {
+      case MAC:
+        wrappedLibrary = new NativeLibraryDarwin();
+        break;
+      case WINDOWS:
+        wrappedLibrary = new NativeLibraryWindows();
+        break;
+      case LINUX:
+      case AIX:
+      case OTHER:
+      default:
+        wrappedLibrary = new NativeLibraryLinux();
+    }
+
+    if (System.getProperty("os.arch").toLowerCase().contains("ppc")) {
+      if (osType == LINUX) {
+        MCL_CURRENT = 0x2000;
+      } else if (osType == AIX) {
+        MCL_CURRENT = 0x100;
+      } else {
+        MCL_CURRENT = 1;
+      }
+    } else {
+      MCL_CURRENT = 1;
+    }
+  }
+
+  private NativeLibrary() {
+  }
+
+  /**
+   * @return the detected OSType of the Operating System running the JVM using crude string matching
+   */
+  private static OSType getOsType() {
 
 Review comment:
   we already detect the OS type using `oal.util.Constants`. We should not duplicate code 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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] janhoy commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping

Posted by GitBox <gi...@apache.org>.
janhoy commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping
URL: https://github.com/apache/lucene-solr/pull/1364#discussion_r396399944
 
 

 ##########
 File path: solr/bootstrap/build.gradle
 ##########
 @@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+
+apply plugin: 'java-library'
+
+jar {
+  manifest {
+    attributes(
+            'Main-Class': 'org.apache.solr.bootstrap.SolrBootstrap',
+            'Class-Path': '. lib/start.jar jna.jar'
 
 Review comment:
   If you get it working, you may in fact push a change to the PR branch

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1364: SOLR-14335: Lock Solr's memory to prevent swapping
URL: https://github.com/apache/lucene-solr/pull/1364#discussion_r395134989
 
 

 ##########
 File path: solr/server/build.gradle
 ##########
 @@ -111,7 +112,12 @@ task assemblePackaging(type: Sync) {
     into "lib/ext"
   })
 
-  from { project.configurations.startJar.singleFile } {
+  from("${buildDir}/libs", {
 
 Review comment:
   This doesn't seem to be right. you rename twice into the same solr.jar. And I don't think it's elegant that the server depends on the launcher (jetty-start). It's a smell.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org