Closed larryrun closed 5 years ago
Thanks for bug report 👍 I'm working on it. It'll be fixed in next patch.
Wow, thanks for the quick fix!
@jjeffcaii I just ran my test again, but I still got the similar panic:
2019/11/19 09:53:38 [WARN] send frame failed: send on closed channel
panic: close of closed channel
goroutine 24 [running]:
github.com/rsocket/rsocket-go/internal/framing.(*BaseFrame).Done(0xc000363be0)
/Users/my-path/go_home/pkg/mod/github.com/rsocket/rsocket-go@v0.5.1/internal/framing/frame.go:160 +0x36
github.com/rsocket/rsocket-go/internal/transport.(*Transport).Send(0xc000180000, 0x1515320, 0xc0002eb760, 0xc000180000, 0x150c560, 0xc0003eb420)
/Users/my-path/go_home/pkg/mod/github.com/rsocket/rsocket-go@v0.5.1/internal/transport/transport.go:82 +0x11d
github.com/rsocket/rsocket-go/internal/socket.(*DuplexRSocket).drainOutBack(0xc00018a000)
/Users/my-path/go_home/pkg/mod/github.com/rsocket/rsocket-go@v0.5.1/internal/socket/duplex.go:988 +0x188
github.com/rsocket/rsocket-go/internal/socket.(*DuplexRSocket).loopWrite(0xc00018a000, 0x15123c0, 0xc000092340, 0x0, 0x0)
/Users/my-path/go_home/pkg/mod/github.com/rsocket/rsocket-go@v0.5.1/internal/socket/duplex.go:1069 +0x3f2
github.com/rsocket/rsocket-go/internal/socket.(*resumeServerSocket).Start(0xc0000f6080, 0x15123c0, 0xc000092340, 0x0, 0x0)
/Users/my-path/go_home/pkg/mod/github.com/rsocket/rsocket-go@v0.5.1/internal/socket/server_resume.go:36 +0x9b
github.com/rsocket/rsocket-go.(*server).serve.func3.2(0x15123c0, 0xc000092340, 0x1515720, 0xc0000f6080)
/Users/my-path/go_home/pkg/mod/github.com/rsocket/rsocket-go@v0.5.1/server.go:220 +0x57
created by github.com/rsocket/rsocket-go.(*server).serve.func3
/Users/my-path/go_home/pkg/mod/github.com/rsocket/rsocket-go@v0.5.1/server.go:219 +0x67e
Exiting.
Is there any change required in my code?
@larryrun Can you show client codes?
client:
cli, err := rsocket.Connect().
Resume().
Fragment(1024).
Transport("tcp://127.0.0.1:7878").
Start(context.Background())
if err != nil {
panic(err)
}
payloadSize := 100
payloadCount := 50000
reqPayloads := genSizedPayload(payloadSize, payloadCount)
send := flux.Create(func(ctx context.Context, s flux.Sink) {
for _, p := range reqPayloads {
s.Next(p)
}
s.Complete()
})
_, err = cli.RequestChannel(send).BlockLast(context.Background())
if err != nil {
panic(err)
}
Thanks! I'll check it later.
Fixed in release v0.5.2. Please check it. Thanks again!
It looks good. thanks!
Hi team, I'm trying the client.RequestChannel feature and got panic in server side when shutting down the client side.(kill the client's process) The testing code is very simple: server:
the panic:
although the client was shutdown without closing the channel, I suppose the server should still be running instead of exit directly