cloudwego / kitex

Go RPC framework with high-performance and strong-extensibility for building micro-services.
https://www.cloudwego.io
Apache License 2.0
6.97k stars 809 forks source link

Multiple Services 在启用 Connection Multiplexing 的情况下不能正常工作 #1285

Closed aaronjheng closed 3 months ago

aaronjheng commented 7 months ago

Describe the bug

Multiple Services 在启用 Connection Multiplexing 的情况下不能正常工作

To Reproduce

Steps to reproduce the behavior:

  1. 克隆 https://github.com/cloudwego/kitex
  2. 修改 protobuf_multi_service
    1. Client 增加 client.WithMuxConnection(1) 选项
    2. Server 增加 server.WithMuxTransport() 选项
  3. 运行 Server
  4. 运行 Client

Expected behavior

Client程序能正常输出

Screenshots

Client 报错 image

Server 报错 image

Kitex version:

0.9.0

Environment:

The output of go env.

Additional context

Marina-Sakai commented 7 months ago

@aaronjheng When you don't add Connection Multiplexing, does it work? If yes, please tell me the result.

aaronjheng commented 7 months ago

Yes. It works.

Marina-Sakai commented 7 months ago

@aaronjheng May I see the result without Connection Multiplexing?

aaronjheng commented 7 months ago

IDL

syntax = "proto3";

option go_package = "multi/service";

package multiservice;

service ServiceA {
  rpc ChatA (RequestA) returns (Reply) {}
  rpc ChatAB (RequestA) returns (Reply) {}
}

service ServiceB {
  rpc ChatB (RequestB) returns (Reply) {}
  rpc ChatAB (RequestB) returns (Reply) {}
}

message RequestA {
  string name = 1;
}

message RequestB {
  string name = 1;
}

message Reply {
  string message = 1;
}

Calls

clientA.ChatA
clientA.ChatAB
clientB.ChatB
clientB.ChatAB

Client

image

Server

image

joway commented 7 months ago

@Marina-Sakai I think we could write a test case to reproduce this case. I think maybe somewhere don't handle some case correctly, because we don't have try multi service in Mux mode.

Marina-Sakai commented 7 months ago

@aaronjheng @joway I reproduced this case and found a bug. I'll fix it. Thank you for your report.

Marina-Sakai commented 6 months ago

@aaronjheng It's fixed in v0.9.2-rc1 version. Please go get that version.