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

Null pointer when connecting to RSocket #24088

Closed
jesty opened this issue Nov 26, 2019 · 3 comments
Closed

Null pointer when connecting to RSocket #24088

jesty opened this issue Nov 26, 2019 · 3 comments
Assignees
Labels
in: messaging Issues in messaging modules (jms, messaging) type: bug A general bug
Milestone

Comments

@jesty
Copy link

jesty commented Nov 26, 2019

I'm trying RSocket and I'm using:

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.2.BUILD-SNAPSHOT</version>
        <relativePath/>
</parent>

My client code looks like:

requester
        .route("test")
        .retrieveFlow<Int>()
        .collect({
            println("Receiving $it")
        })

Starting from today I'm facing this exception:

	at java.util.Objects.requireNonNull(Objects.java:203) ~[na:1.8.0_202]
	at reactor.core.publisher.FluxSource.<init>(FluxSource.java:46) ~[reactor-core-3.3.1.BUILD-SNAPSHOT.jar:3.3.1.BUILD-SNAPSHOT]
	at reactor.core.publisher.Flux.wrap(Flux.java:9869) ~[reactor-core-3.3.1.BUILD-SNAPSHOT.jar:3.3.1.BUILD-SNAPSHOT]
	at reactor.core.publisher.Flux.from(Flux.java:961) ~[reactor-core-3.3.1.BUILD-SNAPSHOT.jar:3.3.1.BUILD-SNAPSHOT]
	at io.rsocket.RSocketRequester.requestChannel(RSocketRequester.java:174) ~[rsocket-core-1.0.0-RC5.jar:na]
	at io.rsocket.util.RSocketProxy.requestChannel(RSocketProxy.java:50) ~[rsocket-core-1.0.0-RC5.jar:na]
	at io.rsocket.util.MultiSubscriberRSocket.lambda$requestChannel$3(MultiSubscriberRSocket.java:47) ~[rsocket-core-1.0.0-RC5.jar:na]
	at reactor.core.publisher.FluxDefer.subscribe(FluxDefer.java:46) ~[reactor-core-3.3.1.BUILD-SNAPSHOT.jar:3.3.1.BUILD-SNAPSHOT]
	at reactor.core.publisher.Flux.subscribe(Flux.java:8128) ~[reactor-core-3.3.1.BUILD-SNAPSHOT.jar:3.3.1.BUILD-SNAPSHOT]
	at kotlinx.coroutines.reactive.PublisherAsFlow.collect(ReactiveFlow.kt:77) ~[kotlinx-coroutines-reactive-1.3.2.jar:na]
	at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.collect(SafeCollector.kt:127) ~[kotlinx-coroutines-core-1.3.2.jar:na]
	at kotlinx.coroutines.flow.FlowKt__CollectKt.collect(Collect.kt:30) ~[kotlinx-coroutines-core-1.3.2.jar:na]
	at kotlinx.coroutines.flow.FlowKt.collect(Unknown Source) ~[kotlinx-coroutines-core-1.3.2.jar:na]

Some days ago everything works as expected, after replacing 2.2.2.BUILD-SNAPSHOT with 2.2.1.BUILD-SNAPSHOT, everything works again.

After debugging the problem seems to be in:

Flux<Payload> payloadFlux = this.payloadMono != null ?
					this.payloadMono.flatMapMany(rsocket::requestStream) :
					rsocket.requestChannel(this.payloadFlux);

With 2.2.1.BUILD-SNAPSHOT the null check returns true, while with 2.2.2.BUILD-SNAPSHOT the null check returns false.

I think that this happens because on this commit someone remove emptyPayload():

@Nullable
private Mono<Payload> payloadMono = emptyPayload();
@jesty jesty changed the title Null pointer when connecto to RSocket Null pointer when connecting to RSocket Nov 26, 2019
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 26, 2019
@rstoyanchev rstoyanchev self-assigned this Nov 27, 2019
@rstoyanchev rstoyanchev added in: messaging Issues in messaging modules (jms, messaging) type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 27, 2019
@rstoyanchev rstoyanchev added this to the 5.2.2 milestone Nov 27, 2019
@rstoyanchev
Copy link
Contributor

rstoyanchev commented Nov 27, 2019

Indeed this is a result of the changes for #23640.

someone remove emptyPayload()

This was a problem in its own right due to creating the empty payload too early, possibly leaving out additional metadata entries added later.

@rstoyanchev
Copy link
Contributor

Thanks for the report @jesty.

@jesty
Copy link
Author

jesty commented Nov 27, 2019

Thanks to you for so fast answer :) @rstoyanchev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: messaging Issues in messaging modules (jms, messaging) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants