Skip to content

Commit

Permalink
Merge branch 'main' into ingest-geoip-processor-anonymous-ip
Browse files Browse the repository at this point in the history
  • Loading branch information
joegallo committed Apr 11, 2024
2 parents a69634f + c8c9187 commit e9ccc8a
Show file tree
Hide file tree
Showing 124 changed files with 3,078 additions and 797 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ public synchronized void stop() {
waitFor(); // ignore exit code, we are already shutting down
}

/**
* Stop the subprocess, sending a SIGKILL.
*/
public void forceStop() {
assert detached == false;
jvmProcess.destroyForcibly();
waitFor();
}

private void sendShutdownMarker() {
try {
OutputStream os = jvmProcess.getOutputStream();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private static String findLibraryPath(Map<String, String> sysprops) {
}
String archname = sysprops.get("os.arch");
String arch;
if (archname.equals("amd64")) {
if (archname.equals("amd64") || archname.equals("x86_64")) {
arch = "x64";
} else if (archname.equals("aarch64")) {
arch = archname;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,12 @@ public void testCommandLineDistributionType() {
public void testLibraryPath() {
assertLibraryPath("Mac OS", "aarch64", "darwin-aarch64");
assertLibraryPath("Mac OS", "amd64", "darwin-x64");
assertLibraryPath("Mac OS", "x86_64", "darwin-x64");
assertLibraryPath("Linux", "aarch64", "linux-aarch64");
assertLibraryPath("Linux", "amd64", "linux-x64");
assertLibraryPath("Linux", "x86_64", "linux-x64");
assertLibraryPath("Windows", "amd64", "windows-x64");
assertLibraryPath("Windows", "x86_64", "windows-x64");
assertLibraryPath("Unknown", "aarch64", "unsupported_os[Unknown]-aarch64");
assertLibraryPath("Mac OS", "Unknown", "darwin-unsupported_arch[Unknown]");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CancellationException;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
Expand Down Expand Up @@ -66,6 +67,7 @@ public class ServerProcessTests extends ESTestCase {
Settings.Builder nodeSettings;
ProcessValidator processValidator;
MainMethod mainCallback;
Runnable forceStopCallback;
MockElasticsearchProcess process;
SecureSettings secrets;

Expand Down Expand Up @@ -93,6 +95,7 @@ public void resetEnv() {
nodeSettings = Settings.builder();
processValidator = null;
mainCallback = null;
forceStopCallback = null;
secrets = KeyStoreWrapper.create();
}

Expand Down Expand Up @@ -162,6 +165,8 @@ public int waitFor() throws InterruptedException {
main.get();
} catch (ExecutionException e) {
throw new AssertionError(e);
} catch (CancellationException e) {
return 137; // process killed
}
if (processException.get() != null) {
throw new AssertionError("Process failed", processException.get());
Expand All @@ -187,6 +192,8 @@ public void destroy() {

public Process destroyForcibly() {
main.cancel(true);
IOUtils.closeWhileHandlingException(stdin, stderr);
forceStopCallback.run();
return this;
}
}
Expand Down Expand Up @@ -361,6 +368,22 @@ public void testStop() throws Exception {
assertThat(terminal.getErrorOutput(), containsString("final message"));
}

public void testForceStop() throws Exception {
CountDownLatch blockMain = new CountDownLatch(1);
CountDownLatch inMain = new CountDownLatch(1);
mainCallback = (args, stdin, stderr, exitCode) -> {
stderr.println(SERVER_READY_MARKER);
inMain.countDown();
nonInterruptibleVoid(blockMain::await);
};
var server = startProcess(false, false);
nonInterruptibleVoid(inMain::await);
forceStopCallback = blockMain::countDown;
server.forceStop();

assertThat(process.main.isCancelled(), is(true)); // stop should have waited
}

public void testWaitFor() throws Exception {
CountDownLatch mainReady = new CountDownLatch(1);
mainCallback = (args, stdin, stderr, exitCode) -> {
Expand Down
5 changes: 5 additions & 0 deletions docs/changelog/107050.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 107050
summary: Fix support for infinite `?master_timeout`
area: Cluster Coordination
type: bug
issues: []
6 changes: 6 additions & 0 deletions docs/changelog/107224.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 107224
summary: "Enable 'encoder' and 'tags_schema' highlighting settings at field level"
area: Highlighting
type: enhancement
issues:
- 94028
5 changes: 5 additions & 0 deletions docs/changelog/107253.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 107253
summary: "[Connector API] Support cleaning up sync jobs when deleting a connector"
area: Application
type: feature
issues: []
6 changes: 6 additions & 0 deletions docs/changelog/107291.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 107291
summary: Support data streams in enrich policy indices
area: Ingest Node
type: enhancement
issues:
- 98836
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ This API deletes a configured collection of
[[ccr-delete-auto-follow-pattern-query-params]]
==== {api-query-parms-title}

`master_timeout`::
(Optional, <<time-units, time units>>) Specifies the period of time to wait for
a connection to the master node. If no response is received before the timeout
expires, the request fails and returns an error. Defaults to `30s`.
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]

[[ccr-delete-auto-follow-pattern-examples]]
==== {api-examples-title}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@ This API will return the specified auto-follow pattern collection.
[[ccr-get-auto-follow-pattern-query-params]]
==== {api-query-parms-title}

`master_timeout`::
(Optional, <<time-units, time units>>) Specifies the period of time to wait for
a connection to the master node. If no response is received before the timeout
expires, the request fails and returns an error. Defaults to `30s`.
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]

[[ccr-get-auto-follow-pattern-examples]]
==== {api-examples-title}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ meantime.
[[ccr-pause-auto-follow-pattern-query-params]]
==== {api-query-parms-title}

`master_timeout`::
(Optional, <<time-units, time units>>) Specifies the period of time to wait for
a connection to the master node. If no response is received before the timeout
expires, the request fails and returns an error. Defaults to `30s`.
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]

[[ccr-pause-auto-follow-pattern-examples]]
==== {api-examples-title}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ the new patterns.
[[ccr-put-auto-follow-pattern-query-params]]
==== {api-query-parms-title}

`master_timeout`::
(Optional, <<time-units, time units>>) Specifies the period of time to wait for
a connection to the master node. If no response is received before the timeout
expires, the request fails and returns an error. Defaults to `30s`.
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]

[[ccr-put-auto-follow-pattern-request-body]]
==== {api-request-body-title}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ have been deleted or closed in the meantime.
[[ccr-resume-auto-follow-pattern-query-params]]
==== {api-query-parms-title}

`master_timeout`::
(Optional, <<time-units, time units>>) Specifies the period of time to wait for
a connection to the master node. If no response is received before the timeout
expires, the request fails and returns an error. Defaults to `30s`.
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]

[[ccr-resume-auto-follow-pattern-examples]]
==== {api-examples-title}
Expand Down
5 changes: 1 addition & 4 deletions docs/reference/ccr/apis/follow/get-follow-info.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ replication options and whether the follower indices are active or paused.
[[ccr-get-follow-info-query-params]]
==== {api-query-parms-title}

`master_timeout`::
(Optional, <<time-units, time units>>) Specifies the period of time to wait for
a connection to the master node. If no response is received before the timeout
expires, the request fails and returns an error. Defaults to `30s`.
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]

[role="child_attributes"]
[[ccr-get-follow-info-response-body]]
Expand Down
5 changes: 1 addition & 4 deletions docs/reference/ccr/apis/follow/post-pause-follow.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ following task.
[[ccr-post-pause-follow-query-params]]
==== {api-query-parms-title}

`master_timeout`::
(Optional, <<time-units, time units>>) Specifies the period of time to wait for
a connection to the master node. If no response is received before the timeout
expires, the request fails and returns an error. Defaults to `30s`.
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]

[[ccr-post-pause-follow-examples]]
==== {api-examples-title}
Expand Down
5 changes: 1 addition & 4 deletions docs/reference/ccr/apis/follow/post-resume-follow.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@ returns, the follower index will resume fetching operations from the leader inde
[[ccr-post-resume-follow-query-params]]
==== {api-query-parms-title}

`master_timeout`::
(Optional, <<time-units, time units>>) Specifies the period of time to wait for
a connection to the master node. If no response is received before the timeout
expires, the request fails and returns an error. Defaults to `30s`.
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]

[[ccr-post-resume-follow-request-body]]
==== {api-request-body-title}
Expand Down
5 changes: 1 addition & 4 deletions docs/reference/ccr/apis/follow/post-unfollow.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ irreversible operation.
[[ccr-post-unfollow-query-params]]
==== {api-query-parms-title}

`master_timeout`::
(Optional, <<time-units, time units>>) Specifies the period of time to wait for
a connection to the master node. If no response is received before the timeout
expires, the request fails and returns an error. Defaults to `30s`.
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]

[[ccr-post-unfollow-examples]]
==== {api-examples-title}
Expand Down
6 changes: 1 addition & 5 deletions docs/reference/ccr/apis/follow/put-follow.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ referenced leader index. When this API returns, the follower index exists, and
follower shard requires transferring all the remote Lucene segment files to
the follower index.

`master_timeout`::
(Optional, <<time-units, time units>>) Specifies the period of time to wait for
a connection to the master node. If no response is received before the timeout
expires, the request fails and returns an error. Defaults to `30s`.

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]

[[ccr-put-follow-request-body]]
==== {api-request-body-title}
Expand Down
5 changes: 1 addition & 4 deletions docs/reference/ccr/apis/get-ccr-stats.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ shard-level stats as in the <<ccr-get-follow-stats,get follower stats API>>.
`timeout`::
(Optional, time) Controls the amount of time to wait for results. Defaults to unlimited.

`master_timeout`::
(Optional, <<time-units, time units>>) Specifies the period of time to wait for
a connection to the master node. If no response is received before the timeout
expires, the request fails and returns an error. Defaults to `30s`.
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]

[role="child_attributes"]
[[ccr-get-stats-response-body]]
Expand Down
Loading

0 comments on commit e9ccc8a

Please sign in to comment.