Versions Opensearch 2.3.0
Describe the issue: I’m trying to create a custom plugin for opensearch and I don’t know if this is the right place to ask for help.
I’m following this template project ‘GitHub - opensearch-project/opensearch-plugin-template-java: Template repo for creating OpenSearch plugins’ with some additional tutorial found on internet.
The project is provided with a simple integration test RenamePluginIT
that extends OpenSearchIntegTestCase
. The first part of the test consist in the creation of a cluster for opensearch inherited from the framework and giving some exception in console during the startup
[2023-03-16T16:41:29,007][WARN ][o.o.t.TcpTransport ] [node_s0] exception caught on transport layer [NioSocketChannel{localAddress=/127.0.0.1:52051, remoteAddress=/127.0.0.1:52053}], closing connection
java.io.IOException: Connessione in corso interrotta forzatamente dall'host remoto
at sun.nio.ch.SocketDispatcher.read0(Native Method) ~[?:?]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43) ~[?:?]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276) ~[?:?]
at sun.nio.ch.IOUtil.read(IOUtil.java:233) ~[?:?]
at sun.nio.ch.IOUtil.read(IOUtil.java:223) ~[?:?]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:358) ~[?:?]
at org.opensearch.nio.SocketChannelContext.readFromChannel(SocketChannelContext.java:288) ~[opensearch-nio-2.3.0-SNAPSHOT.jar:2.3.0-SNAPSHOT]
at org.opensearch.nio.BytesChannelContext.read(BytesChannelContext.java:53) ~[opensearch-nio-2.3.0-SNAPSHOT.jar:2.3.0-SNAPSHOT]
at org.opensearch.nio.EventHandler.handleRead(EventHandler.java:152) [opensearch-nio-2.3.0-SNAPSHOT.jar:2.3.0-SNAPSHOT]
at org.opensearch.transport.nio.TestEventHandler.handleRead(TestEventHandler.java:167) [framework-2.3.0-SNAPSHOT.jar:2.3.0-SNAPSHOT]
at org.opensearch.nio.NioSelector.handleRead(NioSelector.java:438) [opensearch-nio-2.3.0-SNAPSHOT.jar:2.3.0-SNAPSHOT]
at org.opensearch.nio.NioSelector.processKey(NioSelector.java:264) [opensearch-nio-2.3.0-SNAPSHOT.jar:2.3.0-SNAPSHOT]
at org.opensearch.nio.NioSelector.singleLoop(NioSelector.java:191) [opensearch-nio-2.3.0-SNAPSHOT.jar:2.3.0-SNAPSHOT]
at org.opensearch.nio.NioSelector.runLoop(NioSelector.java:148) [opensearch-nio-2.3.0-SNAPSHOT.jar:2.3.0-SNAPSHOT]
at java.lang.Thread.run(Thread.java:834) [?:?]
The cluster start creating (randomly) two hosts on the same ip with 2 different port
[2023-03-16T16:41:28,446][INFO ][o.o.t.TransportService ] [[test_SUITE-TEST_WORKER_VM=[--not-gradle--]-CLUSTER_SEED=[-2469672901485179198]-HASH=[49C50A396E828]-cluster[T#2]]] publish_address {127.0.0.1:52049}, bound_addresses {127.0.0.1:52049}, {[::1]:52050}
[2023-03-16T16:41:28,450][INFO ][o.o.t.TransportService ] [[test_SUITE-TEST_WORKER_VM=[--not-gradle--]-CLUSTER_SEED=[-2469672901485179198]-HASH=[49C50A396E828]-cluster[T#1]]] publish_address {127.0.0.1:52051}, bound_addresses {127.0.0.1:52051}, {[::1]:52052}
When the the cluster is ready (I think) the real test begin with a request of the restclient to use for the next steps. But here I notice something strange in this part of code
as you can see the array contains two host with wrong ip. Debugging I notice that the nodes List contains the right address, but the problem is that node.getInfo(HttpInfo.class)
method return an object with the wrong ip.
The test of course fail with the following timeout error
java.net.ConnectException: Timeout connecting to [/0.0.0.0:80]
at __randomizedtesting.SeedInfo.seed([49EC825673CE3BE4:414BECD918DB197A]:0)
at org.opensearch.client.RestClient.extractAndWrapCause(RestClient.java:953)
at org.opensearch.client.RestClient.performRequest(RestClient.java:332)
at org.opensearch.client.RestClient.performRequest(RestClient.java:320)
at it.package.baseline.BaselinePluginIT.testPluginInstalled(BaselinePluginIT.java:64)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1750)
at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:938)
at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:974)
at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:988)
at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:44)
at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
at org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)
at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:817)
at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:468)
at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:947)
at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:832)
at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:883)
at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:894)
at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
at org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)
at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
at org.apache.lucene.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
at org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.net.ConnectException: Timeout connecting to [/0.0.0.0:80]
at org.apache.http.nio.pool.RouteSpecificPool.timeout(RouteSpecificPool.java:169)
at org.apache.http.nio.pool.AbstractNIOConnPool.requestTimeout(AbstractNIOConnPool.java:632)
at org.apache.http.nio.pool.AbstractNIOConnPool$InternalSessionRequestCallback.timeout(AbstractNIOConnPool.java:898)
at org.apache.http.impl.nio.reactor.SessionRequestImpl.timeout(SessionRequestImpl.java:198)
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processTimeouts(DefaultConnectingIOReactor.java:213)
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:158)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:351)
at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:221)
at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
... 1 more
What am I doing wrong?
Any advice is appreciated.
Thanks