Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Windows】客户端在指定了client.WithTransportProtocol(transport.GRPC) 后服务端出现panic #1154

Open
zhamghaoran opened this issue Oct 28, 2023 · 3 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@zhamghaoran
Copy link

zhamghaoran commented Oct 28, 2023

Describe the bug
我在客户端的连接配置当中制定了client.WithTransportProtocol(transport.GRPC) 之后,调用完成之后服务端会抛出panic
close closed channel

code
client:

func main() {
	registry, err := etcd.NewEtcdResolver([]string{"127.0.0.1:12380"})
	if err != nil {
		panic(err)
	}
	newClient, err := hello.NewClient("Hello", client.WithResolver(registry), client.WithTransportProtocol(transport.GRPC))
	if err != nil {
		fmt.Println(err)
	}
	req := &service.HelloReq{Name: "jjking"}
	send, err := newClient.Send(context.Background(), req)
	if err != nil {
		if bizErr, ok := kerrors.FromBizStatusError(err); ok {
			fmt.Println(bizErr.BizStatusCode())
			fmt.Println(bizErr.BizMessage())
			println(bizErr.(status.Iface).GRPCStatus().Details()[0].(*service.HelloResp).Res)
		}
	}
	fmt.Println(send)
}

server:

func main() {
	registry, err := etcd.NewEtcdRegistry([]string{"127.0.0.1:12380"})
	if err != nil {
		panic(err)
	}
	svr := service.NewServer(new(HelloImpl), server.WithServerBasicInfo(&rpcinfo.EndpointBasicInfo{ServiceName: "Hello"}), server.WithRegistry(registry))
	err = svr.Run()
	if err != nil {
		log.Println(err.Error())
	}
}

handler:

func (s *HelloImpl) Send(ctx context.Context, req *service.HelloReq) (resp *service.HelloResp, err error) {
	resp = &service.HelloResp{Res: "hello " + req.Name}
	return
}

Screenshots

panic: close of closed channel

goroutine 27 [running]:
github.com/cloudwego/kitex/pkg/remote/trans/nphttp2/grpc.(*http2Server).HandleStreams(0xc000134140, 0x14346a0?, 0x169d588?)
        C:/Users/20179/go/pkg/mod/github.com/cloudwego/kitex@v0.7.3/pkg/remote/trans/nphttp2/grpc/http2_server.go:414 +0x79a
github.com/cloudwego/kitex/pkg/remote/trans/nphttp2.(*svrTransHandler).OnRead(0xc00003e690, {0x16ab3d8, 0xc00003efc0}, {0x16af868?, 0xc0003660a0})
        C:/Users/20179/go/pkg/mod/github.com/cloudwego/kitex@v0.7.3/pkg/remote/trans/nphttp2/server_handler.go:123 +0x138
github.com/cloudwego/kitex/pkg/remote/trans/detection.(*svrTransHandler).OnRead(0xc00003e660, {0x16ab3d8, 0xc00003edb0}, {0x16af868, 0xc0003660a0})
        C:/Users/20179/go/pkg/mod/github.com/cloudwego/kitex@v0.7.3/pkg/remote/trans/detection/server_handler.go:95 +0xba
github.com/cloudwego/kitex/pkg/remote.(*TransPipeline).OnRead(0xc0003b0980, {0x16ab3d8?, 0xc00003edb0?}, {0x16af868, 0xc0003660a0})
        C:/Users/20179/go/pkg/mod/github.com/cloudwego/kitex@v0.7.3/pkg/remote/trans_pipeline.go:129 +0xe5
github.com/cloudwego/kitex/pkg/remote/trans/gonet.(*transServer).BootstrapServer.func1()
        C:/Users/20179/go/pkg/mod/github.com/cloudwego/kitex@v0.7.3/pkg/remote/trans/gonet/trans_server.go:101 +0x22b
created by github.com/cloudwego/kitex/pkg/remote/trans/gonet.(*transServer).BootstrapServer in goroutine 12
        C:/Users/20179/go/pkg/mod/github.com/cloudwego/kitex@v0.7.3/pkg/remote/trans/gonet/trans_server.go:85 +0x88

Kitex version:

v0.7.3

Environment:

set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\20179\AppData\Local\go-build
set GOENV=C:\Users\20179\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\20179\go\pkg\mod
set GONOPROXY=git-codecommit.us-east-1.amazonaws.com
set GONOSUMDB=git-codecommit.us-east-1.amazonaws.com
set GOOS=windows
set GOPATH=C:\Users\20179\go
set GOPRIVATE=git-codecommit.us-east-1.amazonaws.com
set GOPROXY=https://goproxy.cn,direct
set GOROOT=C:/Users/20179/go1.21.0
set GOSUMDB=sum.golang.google.cn
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Users\20179\go1.21.0\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.21.0
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=E:\goLandProject\kitex_study\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\20179\AppData\Local\Temp\go-build3491325515=/tmp/go-build -gno-record-gcc-switches

@ppzqh
Copy link
Contributor

ppzqh commented Oct 30, 2023

感谢反馈。当前 windows 环境不支持 gRPC,因改造成本较高,暂时还未修复。

@zhamghaoran
Copy link
Author

感谢反馈。当前 windows 环境不支持 gRPC,因改造成本较高,暂时还未修复。

谢谢

@ppzqh ppzqh self-assigned this Nov 2, 2023
@ppzqh
Copy link
Contributor

ppzqh commented Nov 2, 2023

TODO

@GuangmingLuo GuangmingLuo added the help wanted Extra attention is needed label Aug 28, 2024
@GuangmingLuo GuangmingLuo changed the title 客户端在指定了client.WithTransportProtocol(transport.GRPC) 后服务端出现panic 【Windows】客户端在指定了client.WithTransportProtocol(transport.GRPC) 后服务端出现panic Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Development

No branches or pull requests

3 participants