-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: duplicateA duplicate of another issueA duplicate of another issue
Description
Oleg Kovrizhin opened SPR-14894 and commented
Hello All,
I am playing little bit with spring reactive and found some strange behavior:
I have ArrayIndexOutOfBoundsException when I receive more than 924 entities in the client:
Server side:
@GetMapping("/persons")
@Produces(MediaType.APPLICATION_JSON)
Flux<Person> list() {
return this.repository.findAll().take(925);
}Client side:
ReactorClientHttpConnector clientHttpConnector = new ReactorClientHttpConnector();
ClientRequest.HeadersBuilder<?> get = ClientRequest.GET("http://localhost:8080/persons");
Flux<Person> personFlux = WebClient.create(clientHttpConnector).retrieveFlux(get.build(), Person.class);
System.out.println(personFlux.toStream().count());
Stack Trace:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -8236
at io.netty.buffer.HeapByteBufUtil.getByte(HeapByteBufUtil.java:24)
at io.netty.buffer.UnpooledHeapByteBuf._getByte(UnpooledHeapByteBuf.java:323)
at io.netty.buffer.UnpooledHeapByteBuf.getByte(UnpooledHeapByteBuf.java:318)
at org.springframework.http.codec.json.JsonObjectDecoder$1.apply(JsonObjectDecoder.java:140)
at org.springframework.http.codec.json.JsonObjectDecoder$1.apply(JsonObjectDecoder.java:103)
at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:353)
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:120)
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:120)
at reactor.core.publisher.FluxSubscribeOn$SubscribeOnSubscriber.onNext(FluxSubscribeOn.java:148)
at reactor.ipc.netty.common.NettyChannelHandler$InboundSink.drain(NettyChannelHandler.java:707)
at reactor.ipc.netty.common.NettyChannelHandler$InboundSink.next(NettyChannelHandler.java:616)
at reactor.ipc.netty.common.NettyChannelHandler.doRead(NettyChannelHandler.java:134)
at reactor.ipc.netty.http.NettyHttpClientHandler.channelRead(NettyHttpClientHandler.java:133)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:373)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:351)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:280)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:396)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:373)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:351)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:373)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:129)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:651)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:574)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:488)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:450)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873)
at java.lang.Thread.run(Thread.java:745)
gradle:
compile "org.springframework:spring-core:5.0.0.M3"
compile "org.springframework:spring-web:5.0.0.M3"
compile "org.springframework:spring-web-reactive:5.0.0.M3"
compile "io.netty:netty-all:4.1.6.Final"
compile "io.projectreactor.ipc:reactor-netty:0.5.2.RELEASE"
Then I decriese count of produced entity, all works fine, and I recieved all entities.
Best regards,
Oleg
Affects: 5.0 M3
Issue Links:
- JsonObjectDecoder throws ArrayIndexOutOfBoundsException: -1 with valid input [SPR-15013] #19580 JsonObjectDecoder throws ArrayIndexOutOfBoundsException: -1 with valid input ("duplicates")
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: duplicateA duplicate of another issueA duplicate of another issue