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

requestChannel cancel panic #122

Open
chacent opened this issue Apr 28, 2022 · 1 comment
Open

requestChannel cancel panic #122

chacent opened this issue Apr 28, 2022 · 1 comment

Comments

@chacent
Copy link

chacent commented Apr 28, 2022

Expected Behavior

Actual Behavior

发生异常: panic
"unreachable: should never occur socket.requestChannelCallback!"

Steps to Reproduce

rsocket.RequestChannel(func(remote flux.Flux) flux.Flux {
					var sub rx.Subscription
					remote.Subscribe(
						context.Background(),
						rx.OnSubscribe(func(ctx context.Context, s rx.Subscription) {
							sub = s
							sub.Request(1)
						}),
						rx.OnComplete(func() {
							print()
						}),
						rx.OnError(func(e error) {
							print()
						}),
						rx.OnNext(func(input payload.Payload) error {
							sub.Cancel() //for some reason,i don't want continue
							return nil
						}),
					)
					return flux.Create(func(ctx context.Context, s flux.Sink) {})
				}),

Possible Solution

	switch vv := v.(type) {
	case requestResponseCallbackReverse:
		vv.su.Cancel()
	case requestStreamCallbackReverse:
		vv.su.Cancel()
	case requestChannelCallback:
		vv.snd.Cancel() //should i?
	case respondChannelCallback:
		vv.snd.Cancel()
	default:
		panic(fmt.Sprintf("unreachable: should never occur %T!", vv))
	}

Your Environment

  • RSocket version(s) used:
  • Other relevant libraries versions (eg. netty, ...):
  • Platform (eg. JVM version (javar -version) or Node version (node --version)):
  • OS and version (eg uname -a):
@chacent
Copy link
Author

chacent commented Apr 28, 2022

i'm sorry , rsocket.RequestChannel is part of the responder in server side. and bug occure in the client side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant