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

using runtime-jdk=bundled prior to elasticsearch 7 results in elasticserach using java from the path #985

Closed
hub-cap opened this issue May 4, 2020 · 1 comment · Fixed by #987
Labels
:Benchmark Candidate Management Anything affecting how Rally sets up Elasticsearch bug Something's wrong
Milestone

Comments

@hub-cap
Copy link
Contributor

hub-cap commented May 4, 2020

Running esrally with --runtime-jdk=bundled on a version prior to 7.0.0, does not error out. Instead it just uses java it finds on the PATH, and also does not honor environment variables or the car JDK definitions

➜  env|grep JAVA
JAVA10_HOME=/opt/java/jdk-10.0.1
JAVA11_HOME=/opt/java/jdk-11
JAVA12_HOME=/opt/java/jdk-12
JAVA13_HOME=/opt/java/jdk-13.0.1
JAVA7_HOME=/opt/java/jdk1.7.0_80
JAVA8_HOME=/opt/java/jdk1.8.0_172
JAVA9_HOME=/opt/java/jdk-9.0.4
JAVA_HOME=/opt/java/jdk-14.0.1
JAVA14_HOME=/opt/java/jdk-14.0.1
➜  . .venv/bin/activate                                                                                            
(.venv) ➜  esrally --distribution-version=6.8.0 --runtime-jdk=bundled  

and in another tab

➜  ~ ps aux|grep java

baz      26174  264  1.9 4969716 1281528 ?     Sl   16:12   0:18 /bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.io.tmpdir=/tmp/elasticsearch-9416369777544052768 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/baz/.rally/benchmarks/races/c8c3e160-9af4-40be-bfdc-80e9d89d85e8/rally-node-0/heapdump -XX:ErrorFile=/home/baz/.rally/benchmarks/races/c8c3e160-9af4-40be-bfdc-80e9d89d85e8/rally-node-0/logs/server/hs_err_pid%p.log -Djava.locale.providers=COMPAT -XX:UseAVX=2 -XX:+ExitOnOutOfMemoryError -Des.path.home=/home/baz/.rally/benchmarks/races/c8c3e160-9af4-40be-bfdc-80e9d89d85e8/rally-node-0/install/elasticsearch-6.8.0 -Des.path.conf=/home/baz/.rally/benchmarks/races/c8c3e160-9af4-40be-bfdc-80e9d89d85e8/rally-node-0/install/elasticsearch-6.8.0/config -Des.distribution.flavor=oss -Des.distribution.type=tar -cp /home/baz/.rally/benchmarks/races/c8c3e160-9af4-40be-bfdc-80e9d89d85e8/rally-node-0/install/elasticsearch-6.8.0/lib/* org.elasticsearch.bootstrap.Elasticsearch -d -p pid          
@hub-cap hub-cap added the bug Something's wrong label May 4, 2020
@danielmitterdorfer danielmitterdorfer added the :Benchmark Candidate Management Anything affecting how Rally sets up Elasticsearch label May 5, 2020
@danielmitterdorfer
Copy link
Member

I think this should be a fairly targeted fix. We already define a car variable runtime.jdk.bundled (in rally-teams) to determine whether a bundled JDK is allowed and it can be used to detect this condition.

However when we resolve JAVA_HOME we don't check anymore whether a bundled JDK is allowed:

if runtime_jdk_versions[0] == "bundled":
logger.info("Using JDK bundled with Elasticsearch.")
# assume that the bundled JDK is the highest available; the path is irrelevant
return allowed_runtime_jdks[0], None

@danielmitterdorfer danielmitterdorfer added this to the 2.0.1 milestone May 5, 2020
hub-cap added a commit to hub-cap/rally that referenced this issue May 6, 2020
When the bundled JDK was introduced, it was added to the car config
file. This check uses the value from the car config to ensure that the
bundled JDK is allowed to be used as specified by the config. If not, it
throws an exception.

Closes elastic#985
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Benchmark Candidate Management Anything affecting how Rally sets up Elasticsearch bug Something's wrong
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants