You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Bug] Dubbo3.3.1 During the initialization process of AbstractServer, the doOpen() method publishes the uninitialized internal state to the external thread, resulting in: "this.dubboChannels" is null.
#14848
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
3.3.1
Steps to reproduce this issue
accidental
example:
public abstract class ServerSuper {
public ServerSuper() throws InterruptedException {
this.open();
}
public abstract void open();
}
public class ServerSub extends ServerSuper {
private static ExecutorService newFixedThreadPool = Executors.newFixedThreadPool(100);
private final Object shouldNonNull = new Object();
public ServerSub() throws InterruptedException {
super();
}
public static void main(String[] args) {
IntStream
.range(0, 10000)
.forEach(index -> {
try {
new ServerSub();
} catch (InterruptedException e) {
e.printStackTrace();
}
});
newFixedThreadPool.shutdown();
}
@Override
public void open() {
newFixedThreadPool
.execute(() -> {
if (shouldNonNull == null) {
throw new IllegalStateException("shouldNonNull was null");
}
});
try {
TimeUnit.MILLISECONDS.sleep(RandomUtils.nextLong(0, 2));
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
What you expected to happen
2024-11-02 11:50:08.268 [TID: N/A] �[35mNettyServerWorker-9-1�[m �[31mERROR�[m �[1;36mLog4j2Logger.java:126�[m - [DUBBO] Unexpected exception from downstream before protocol detected., dubbo version: 3.3.1, current host: , error code: 99-0. This may be caused by unknown error in remoting module, go to https://dubbo.apache.org/faq/99/0 to find instructions.
java.lang.NullPointerException: Cannot invoke "java.util.Map.put(Object, Object)" because "this.dubboChannels" is null
at org.apache.dubbo.remoting.transport.netty4.NettyChannelHandler.channelActive(NettyChannelHandler.java:52) ~[dubbo-3.3.1.jar!/:3.3.1]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:262) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:238) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelActive(AbstractChannelHandlerContext.java:231) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelActive(DefaultChannelPipeline.java:1398) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:258) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:238) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelActive(DefaultChannelPipeline.java:895) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:522) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe.access$200(AbstractChannel.java:429) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:486) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[netty-common-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[netty-common-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[netty-common-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.87.Final.jar!/:4.1.87.Final]
at java.lang.Thread.run(Thread.java:840) ~[?:?]
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!
Pre-check
Search before asking
Apache Dubbo Component
Java SDK (apache/dubbo)
Dubbo Version
3.3.1
Steps to reproduce this issue
accidental
example:
public abstract class ServerSuper {
public ServerSuper() throws InterruptedException {
this.open();
}
public abstract void open();
}
public class ServerSub extends ServerSuper {
}
What you expected to happen
2024-11-02 11:50:08.268 [TID: N/A] �[35mNettyServerWorker-9-1�[m �[31mERROR�[m �[1;36mLog4j2Logger.java:126�[m - [DUBBO] Unexpected exception from downstream before protocol detected., dubbo version: 3.3.1, current host: , error code: 99-0. This may be caused by unknown error in remoting module, go to https://dubbo.apache.org/faq/99/0 to find instructions.
java.lang.NullPointerException: Cannot invoke "java.util.Map.put(Object, Object)" because "this.dubboChannels" is null
at org.apache.dubbo.remoting.transport.netty4.NettyChannelHandler.channelActive(NettyChannelHandler.java:52) ~[dubbo-3.3.1.jar!/:3.3.1]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:262) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:238) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelActive(AbstractChannelHandlerContext.java:231) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelActive(DefaultChannelPipeline.java:1398) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:258) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:238) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelActive(DefaultChannelPipeline.java:895) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:522) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe.access$200(AbstractChannel.java:429) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:486) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[netty-common-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[netty-common-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[netty-common-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) ~[netty-transport-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.87.Final.jar!/:4.1.87.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.87.Final.jar!/:4.1.87.Final]
at java.lang.Thread.run(Thread.java:840) ~[?:?]
Anything else
No response
Are you willing to submit a pull request to fix on your own?
Code of Conduct
The text was updated successfully, but these errors were encountered: