OpenSearch: [BUG] OpenSearch 2.19.0 with installed repository-s3 plugin cannot be stopped

Describe the bug

When the repository-s3 plugin is installed, it is no longer possible to stop a running OpenSearch instance. Happens since 2.19.0.

Related component

Plugins

To Reproduce

  1. Start OpenSearch with installed ‘repository-s3’ plugin
curl -O https://artifacts.opensearch.org/releases/bundle/opensearch/2.19.0/opensearch-2.19.0-linux-x64.tar.gz
tar xvfz opensearch-2.19.0-linux-x64.tar.gz
cd opensearch-2.19.0/
bin/opensearch-plugin install repository-s3
echo 'plugins.security.disabled: true' >> config/opensearch.yml
bin/opensearch
  1. now wait until OpenSearch has started … and try to stop it by pressing CONTROL/STRG+c

=> It does not stop, shows the following exception and hangs (must be killed)

[2025-02-14T11:02:16,876][ERROR][i.n.u.c.D.rejectedExecution] [Mac.lan] Failed to submit a listener notification task. Event loop shut down?
java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "getClassLoader")
	at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:485) ~[?:?]
	at java.base/java.security.AccessController.checkPermission(AccessController.java:1068) ~[?:?]
	at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:416) ~[?:?]
	at java.base/java.lang.ClassLoader.checkClassLoaderPermission(ClassLoader.java:2060) ~[?:?]
	at java.base/java.lang.Thread.getContextClassLoader(Thread.java:1502) ~[?:?]
	at io.netty.util.concurrent.GlobalEventExecutor.startThread(GlobalEventExecutor.java:239) ~[netty-common-4.1.117.Final.jar:4.1.117.Final]
	at io.netty.util.concurrent.GlobalEventExecutor.execute0(GlobalEventExecutor.java:232) ~[netty-common-4.1.117.Final.jar:4.1.117.Final]
	at io.netty.util.concurrent.GlobalEventExecutor.execute(GlobalEventExecutor.java:226) ~[netty-common-4.1.117.Final.jar:4.1.117.Final]
	at io.netty.util.concurrent.DefaultPromise.safeExecute(DefaultPromise.java:862) [netty-common-4.1.117.Final.jar:4.1.117.Final]
	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:500) [netty-common-4.1.117.Final.jar:4.1.117.Final]
	at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:636) [netty-common-4.1.117.Final.jar:4.1.117.Final]
	at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:625) [netty-common-4.1.117.Final.jar:4.1.117.Final]
	at io.netty.util.concurrent.DefaultPromise.setSuccess(DefaultPromise.java:97) [netty-common-4.1.117.Final.jar:4.1.117.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:1059) [netty-common-4.1.117.Final.jar:4.1.117.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.117.Final.jar:4.1.117.Final]
	at java.base/java.lang.Thread.run(Thread.java:840) [?:?]

Expected behavior

OpenSearch should not hang on stop when the repository-s3 plugin is installed.

Additional Details

Plugins

  • all plugins of 2.19.0
  • repository-s3

Host/Environment (please complete the following information):

  • OS: macOS Sequoia
  • Version 15.3.1

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 6
  • Comments: 31 (21 by maintainers)

Commits related to this issue

Most upvoted comments

Facing the same problem. Since we use scripts to start/stop OS, this is a blocker for us to update. I will try to replace netty locally to see if that helps me as a workaround

I think we could not update the published binaries without the version bump, right?

Yes! Maven does not allow overwriting the same version binaries. Recommend to do a patch instead to avoid having different artifacts on different platforms.

Thanks @olfuerniss then we are good to release on Thursday!

LGTM 😃

curl -O https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.19.1/10855/linux/x64/tar/builds/opensearch/core-plugins/repository-s3-2.19.1.zip
curl -O https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.19.1/10855/linux/x64/tar/dist/opensearch/opensearch-2.19.1-linux-x64.tar.gz
tar xvfz opensearch-2.19.1-linux-x64.tar.gz
cd opensearch-2.19.1/
bin/opensearch-plugin install file:///Users/of/tmp/repository-s3-2.19.1.zip
echo 'plugins.security.disabled: true' >> config/opensearch.yml
bin/opensearch

Check installed plugins

curl 'localhost:9200/_cat/plugins'

Mac.lan opensearch-alerting                  2.19.1.0
Mac.lan opensearch-anomaly-detection         2.19.1.0
Mac.lan opensearch-asynchronous-search       2.19.1.0
Mac.lan opensearch-cross-cluster-replication 2.19.1.0
Mac.lan opensearch-custom-codecs             2.19.1.0
Mac.lan opensearch-flow-framework            2.19.1.0
Mac.lan opensearch-geospatial                2.19.1.0
Mac.lan opensearch-index-management          2.19.1.0
Mac.lan opensearch-job-scheduler             2.19.1.0
Mac.lan opensearch-knn                       2.19.1.0
Mac.lan opensearch-ltr                       2.19.1.0
Mac.lan opensearch-ml                        2.19.1.0
Mac.lan opensearch-neural-search             2.19.1.0
Mac.lan opensearch-notifications             2.19.1.0
Mac.lan opensearch-notifications-core        2.19.1.0
Mac.lan opensearch-observability             2.19.1.0
Mac.lan opensearch-performance-analyzer      2.19.1.0
Mac.lan opensearch-reports-scheduler         2.19.1.0
Mac.lan opensearch-security                  2.19.1.0
Mac.lan opensearch-security-analytics        2.19.1.0
Mac.lan opensearch-skills                    2.19.1.0
Mac.lan opensearch-sql                       2.19.1.0
Mac.lan opensearch-system-templates          2.19.1.0
Mac.lan query-insights                       2.19.1.0
Mac.lan repository-s3                        2.19.1

AND … now it can be stopped with Control+C. Thanks!!!

Hi @olfuerniss @spapadop @HenryTheSir @moesterheld @shpatserman @reta could you please help confirm the above Release Candidates posted by @Divyaasm solves the issues?

We will go ahead with a official release on 2025/02/27.

Thanks!

Yes, the issue is resolved, thanks @peterzhuamazon

2.19.1 Release Issue can be tracked here

Yeah, it looks like a 2.19.1 patch release is probably the way to go here. FYI @getsaurabh02

It’s also worth thinking about how we missed this in testing.

Why is this issue not mentioned in the release notes?

Tested the first RC of 2.19.1 to confirm if the issue is resolved. LGTM! . Find the RC details here for testing.

`[2025-02-24T17:37:34,361][INFO` ][o.o.i.i.m.ISMTemplateService] [bcd07416bf93] Successfully update template migration setting
^C[2025-02-24T17:37:51,761][INFO ][o.o.s.a.r.AuditMessageRouter] [bcd07416bf93] Closing AuditMessageRouter
[2025-02-24T17:37:51,761][INFO ][o.o.n.Node               ] [bcd07416bf93] stopping ...
[2025-02-24T17:37:51,763][INFO ][o.o.s.a.s.SinkProvider   ] [bcd07416bf93] Closing InternalOpenSearchSink
[2025-02-24T17:37:51,763][INFO ][o.o.s.a.s.SinkProvider   ] [bcd07416bf93] Closing DebugSink
[2025-02-24T17:37:51,910][INFO ][o.o.n.Node               ] [bcd07416bf93] stopped
[2025-02-24T17:37:51,910][INFO ][o.o.n.Node               ] [bcd07416bf93] closing ...
[2025-02-24T17:37:51,913][INFO ][o.o.s.a.i.AuditLogImpl   ] [bcd07416bf93] Closing AuditLogImpl
[2025-02-24T17:37:51,919][INFO ][o.o.n.Node               ] [bcd07416bf93] closed

Adding @krisfreedain @nateynateynate @kolchfa-aws that 2.19.1 is coming next week.

I’m not sure if its possible with the current tests in the repository-s3 module, but ISM has interesting test cleanup logic that checks for running threads and I have seen it catch issues like this in the past.

yeap I double-confirm, everything seems happy without repository-s3.

faced exactly the same just after the upgrade (running on AlmaLinux9 and installing using the RPM)