You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Jakov Varenina (Jira)" <ji...@apache.org> on 2022/05/04 13:27:00 UTC

[jira] [Assigned] (GEODE-10268) Peer-to-peer connection due to race condition overtakes the --server-port causing server to hang during startup

     [ https://issues.apache.org/jira/browse/GEODE-10268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jakov Varenina reassigned GEODE-10268:
--------------------------------------

    Assignee:     (was: Jakov Varenina)

> Peer-to-peer connection due to race condition overtakes the --server-port causing server to hang during startup
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: GEODE-10268
>                 URL: https://issues.apache.org/jira/browse/GEODE-10268
>             Project: Geode
>          Issue Type: Bug
>            Reporter: Jakov Varenina
>            Priority: Major
>         Attachments: reproducedBindRejectedDueToPeerToPeer.txt
>
>
> {color:#0e101a}The issue is reproduced ({color}[^reproducedBindRejectedDueToPeerToPeer.txt]{color:#0e101a} ) with the patch at creating the acceptor that tries to bind the port already used in peer-to-peer connection. The problem is that distributed system starts before the client/server connection acceptor listener. Because of that, a peer-to-peer connection may take the port configured in the --server-port parameter. Also, it seems that these peer-to-peer connections take ports outside the range configured {color}*{color:#0e101a}with the membership-port-range{color}* {color:#0e101a}parameter:{color}
> {code:java}
> [vm1] membership-port-range=41000-61000{code}
> The peer-to-peer connection:
> {color:#0e101a}[vm1] [debug 2022/05/02 *11:15:57.968* {color}CEST server-1 <RMI TCP Connection(1)-192.168.1.36> tid=0x1a] starting peer-to-peer handshake on socket Socket[addr=/192.168.1.36,port=49913,{color:#de350b}*localport=37392*{color}]
> Server try to create acceptor later on:
> {code:java}
> [vm1] exeption for java.net.BindException: Failed to create server socket on 192.168.1.36[37392]
> [vm1] [info 2022/05/02 11:16:00.421 CEST server-1 <RMI TCP Connection(1)-192.168.1.36> tid=0x1a] Got result: EXCEPTION_OCCURRED
> [vm1] java.lang.RuntimeException: unable to start server
> [vm1]     at org.apache.geode.test.junit.rules.ServerStarterRule.startServer(ServerStarterRule.java:225)
> [vm1]     at org.apache.geode.test.junit.rules.ServerStarterRule.before(ServerStarterRule.java:99)
> [vm1]     at org.apache.geode.test.dunit.rules.ClusterStartupRule.lambda$startServerVM$6d6c10c2$1(ClusterStartupRule.java:284)
> [vm1]     at org.apache.geode.test.dunit.internal.IdentifiableCallable.call(IdentifiableCallable.java:41)
> [vm1]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [vm1]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> [vm1]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> [vm1]     at java.lang.reflect.Method.invoke(Method.java:498)
> [vm1]     at org.apache.geode.test.dunit.internal.MethodInvoker.executeObject(MethodInvoker.java:123)
> [vm1]     at org.apache.geode.test.dunit.internal.RemoteDUnitVM.executeMethodOnObject(RemoteDUnitVM.java:78)
> [vm1]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [vm1]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> [vm1]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> [vm1]     at java.lang.reflect.Method.invoke(Method.java:498)
> [vm1]     at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
> [vm1]     at sun.rmi.transport.Transport$1.run(Transport.java:200)
> [vm1]     at sun.rmi.transport.Transport$1.run(Transport.java:197)
> [vm1]     at java.security.AccessController.doPrivileged(Native Method)
> [vm1]     at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
> [vm1]     at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
> [vm1]     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
> [vm1]     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
> [vm1]     at java.security.AccessController.doPrivileged(Native Method)
> [vm1]     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
> [vm1]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> [vm1]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> [vm1]     at java.lang.Thread.run(Thread.java:748)
> [vm1] Caused by: java.net.BindException: Failed to create server socket on 192.168.1.36[37392]
> [vm1]     at org.apache.geode.distributed.internal.tcpserver.ClusterSocketCreatorImpl.createServerSocket(ClusterSocketCreatorImpl.java:75)
> [vm1]     at org.apache.geode.internal.net.SCClusterSocketCreator.createServerSocket(SCClusterSocketCreator.java:55)
> [vm1]     at org.apache.geode.internal.net.SocketCreator.createServerSocket(SocketCreator.java:491)
> [vm1]     at org.apache.geode.internal.cache.tier.sockets.AcceptorImpl.<init>(AcceptorImpl.java:589)
> [vm1]     at org.apache.geode.internal.cache.tier.sockets.AcceptorBuilder.create(AcceptorBuilder.java:291)
> [vm1]     at org.apache.geode.internal.cache.CacheServerImpl.createAcceptor(CacheServerImpl.java:420)
> [vm1]     at org.apache.geode.internal.cache.CacheServerImpl.start(CacheServerImpl.java:377)
> [vm1]     at org.apache.geode.test.junit.rules.ServerStarterRule.startServer(ServerStarterRule.java:223)
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)