apache/dubbo

[Bug] all channels of the EventLoop delay time

Open

#13.853 geöffnet am 7. März 2024

Auf GitHub ansehen
 (8 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Java (26.453 Forks)batch import
component/sdkgood first issuehelp wantedtype/bug

Repository-Metriken

Stars
 (41.524 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 7T 14h) (20 gemergte PRs in 30 T)

Beschreibung

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

dubbo 3.2.12

Steps to reproduce this issue

org.apache.dubbo.remoting.transport.netty4.NettyConnectionClient.ConnectionListener#operationComplete

 final EventLoop loop = future.channel().eventLoop();
            loop.schedule(
                    () -> {
                        try {
                            connectionClient.doConnect();
                        } catch (RemotingException e) {
                            LOGGER.error(
                                    TRANSPORT_FAILED_RECONNECT,
                                    "",
                                    "",
                                    "Failed to connect to server: " + getConnectAddress());
                        }
                    },
                    1L,
                    TimeUnit.SECONDS);

connectionClient Always fails to connect, default connection wait time is 3 seconds. This will occupy the EventLoop CPU from time to time, and indirectly affect the communication of other registered EventLoop channels. Sometimes there may be a request timeout.

  1. The server receives the request with a delay.Timely
  2. server execution is short, client still sometimes timeout.

What you expected to happen

  1. Simply handle the connection and wait only for a shorter period of time. For example, 500ms, this way, has been provided. The dead loop body occupies the EventLoop for a long time.

  2. It is recommended to add a user thread instead of the EventLoop

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

Contributor Guide