Skip to content

Commit

Permalink
[3.0-Triple] Fix duplicate wrap executor (apache#10293)
Browse files Browse the repository at this point in the history
* fix wrap executor

* fix

* fix
  • Loading branch information
EarthChen authored and guohao committed Jul 14, 2022
1 parent 8bd1050 commit 5352b76
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.threadpool.serial.SerializingExecutor;
import org.apache.dubbo.common.utils.StringUtils;
import org.apache.dubbo.rpc.CancellationContext;
import org.apache.dubbo.rpc.Invoker;
Expand Down Expand Up @@ -87,7 +86,8 @@ public abstract class AbstractServerCall implements ServerCall, ServerStream.Lis
Objects.requireNonNull(serviceDescriptor,
"No service descriptor found for " + invoker.getUrl());
this.invoker = invoker;
this.executor = new SerializingExecutor(executor);
// is already serialized in the stream, so we don't need to serialize it again.
this.executor = executor;
this.frameworkModel = frameworkModel;
this.serviceDescriptor = serviceDescriptor;
this.serviceName = serviceName;
Expand Down Expand Up @@ -124,8 +124,8 @@ public final void sendMessage(Object message) {
if (closed) {
throw new IllegalStateException("Stream has already canceled");
}
final Runnable sendMessage = () -> doSendMessage(message);
executor.execute(sendMessage);
// is already in executor
doSendMessage(message);
}

private void doSendMessage(Object message) {
Expand Down Expand Up @@ -301,7 +301,7 @@ public boolean isAutoRequestN() {


public void close(TriRpcStatus status, Map<String, Object> attachments) {
executor.execute(() -> doClose(status, attachments));
doClose(status, attachments);
}

private void doClose(TriRpcStatus status, Map<String, Object> attachments) {
Expand Down

0 comments on commit 5352b76

Please sign in to comment.