Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-14335: Lock Solr's memory to prevent swapping #1364

Closed
wants to merge 9 commits into from

Conversation

janhoy
Copy link
Contributor

@janhoy janhoy commented Mar 19, 2020

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

solr/server/build.gradle Outdated Show resolved Hide resolved
Add Main-Class and Class-Path to solr.jar manifest
@janhoy
Copy link
Contributor Author

janhoy commented Mar 20, 2020

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...

manifest {
attributes(
'Main-Class': 'org.apache.solr.bootstrap.SolrBootstrap',
'Class-Path': '. lib/start.jar jna.jar'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you get it working, you may in fact push a change to the PR branch

@janhoy
Copy link
Contributor Author

janhoy commented Dec 8, 2021

Lucene and Solr development has moved to separate git repositories and this PR is being bulk-closed.\nPlease open a new PR against https://github.com/apache/solr or https://github.com/apache/lucene if your contribution is still relevant to the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants