-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Memory locking on Windows with the bundled jdk was broken by native access refactoring. This commit fixes the linking issue, as well as adds a packaging test to ensure memory locking is invoked on all supported platforms.
- Loading branch information
Showing
3 changed files
with
67 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pr: 111866 | ||
summary: Fix windows memory locking | ||
area: Infra/Core | ||
type: bug | ||
issues: | ||
- 111847 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
qa/packaging/src/test/java/org/elasticsearch/packaging/test/MemoryLockingTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
package org.elasticsearch.packaging.test; | ||
|
||
import org.elasticsearch.packaging.util.ServerUtils; | ||
import org.elasticsearch.packaging.util.docker.DockerRun; | ||
|
||
import java.util.Map; | ||
|
||
import static org.elasticsearch.packaging.util.docker.Docker.runContainer; | ||
import static org.elasticsearch.packaging.util.docker.DockerRun.builder; | ||
|
||
public class MemoryLockingTests extends PackagingTestCase { | ||
|
||
public void test10Install() throws Exception { | ||
install(); | ||
} | ||
|
||
public void test20MemoryLockingEnabled() throws Exception { | ||
configureAndRun( | ||
Map.of( | ||
"bootstrap.memory_lock", | ||
"true", | ||
"xpack.security.enabled", | ||
"false", | ||
"xpack.security.http.ssl.enabled", | ||
"false", | ||
"xpack.security.enrollment.enabled", | ||
"false", | ||
"discovery.type", | ||
"single-node" | ||
) | ||
); | ||
// TODO: very locking worked. logs? check memory of process? at least we know the process started successfully | ||
stopElasticsearch(); | ||
} | ||
|
||
public void configureAndRun(Map<String, String> settings) throws Exception { | ||
if (distribution().isDocker()) { | ||
DockerRun builder = builder(); | ||
settings.forEach(builder::envVar); | ||
runContainer(distribution(), builder); | ||
} else { | ||
|
||
for (var setting : settings.entrySet()) { | ||
ServerUtils.addSettingToExistingConfiguration(installation.config, setting.getKey(), setting.getValue()); | ||
} | ||
ServerUtils.removeSettingFromExistingConfiguration(installation.config, "cluster.initial_master_nodes"); | ||
} | ||
|
||
startElasticsearch(); | ||
} | ||
} |