dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

[Bug] all channels of the EventLoop delay time

Open 6Glory9 opened this issue 11 months ago • 6 comments

Pre-check

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

Search before asking

  • [X] 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?

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

Code of Conduct

6Glory9 avatar Mar 07 '24 08:03 6Glory9

@icodening PTAL

AlbumenJ avatar Mar 08 '24 02:03 AlbumenJ

Same as #13041. Welcome to submit PR

icodening avatar Mar 08 '24 02:03 icodening

I'm willing to do it ,pls assign to me.

tritone-l avatar Mar 13 '24 12:03 tritone-l

I'm willing to do it ,pls assign to me.

We have a PR related with this issue. For further improvement, we need to consider use async connection future instead of sync. But this may cause a lot of changes in Dubbo. And would you like to work for it?

AlbumenJ avatar Mar 14 '24 06:03 AlbumenJ

I'm willing to do it ,pls assign to me.

We have a PR related with this issue. For further improvement, we need to consider use async connection future instead of sync. But this may cause a lot of changes in Dubbo. And would you like to work for it?我们有一个与此问题相关的 PR。为了进一步改进,我们需要考虑使用异步连接 future 而不是同步。但这可能会导致Dubbo发生很多变化。你愿意为此工作吗?

Should we close this issue and create a new feature to describe this functionality?

wcy666103 avatar Jun 05 '24 06:06 wcy666103

I'm willing to do it ,pls assign to me.

We have a PR related with this issue. For further improvement, we need to consider use async connection future instead of sync. But this may cause a lot of changes in Dubbo. And would you like to work for it?我们有一个与此问题相关的 PR。为了进一步改进,我们需要考虑使用异步连接 future 而不是同步。但这可能会导致Dubbo发生很多变化。你愿意为此工作吗?

Should we close this issue and create a new feature to describe this functionality?

Here you go

AlbumenJ avatar Jun 06 '24 03:06 AlbumenJ