Comments (7)
See also reactor/reactor-core#1486.
from spring-data-r2dbc.
That's fixed now.
from spring-data-r2dbc.
One thing to correct is this IllegalStateException
happens only after commenting the code of Mono.error(new RuntimeException("6"))
, which means it doesn't work when no error happens.
from spring-data-r2dbc.
I wasn't able to reproduce the issue (see reproducer code. Can you provide a complete, minimal, verifiable sample that reproduces the problem, ideally as GitHub repository or Gist?
from spring-data-r2dbc.
@mp911de check this reproducer code
Just as I said above, error only happens without Mono.error()
,
here is what's different between me and your reproduce code:
LegoSet legoSet1 = new LegoSet(null, "SCHAUFELRADBAGGER", 12);
LegoSet legoSet2 = new LegoSet(null, "SCHAUFELRADBAGGER", 13);
Flux<Map<String, Object>> transactional = client.inTransaction(db ->
legoSetRepository.save(legoSet1)
.then(legoSetRepository.save(legoSet2))
.then(Mono.empty()));
and the error - Caused by: java.lang.IllegalStateException: Connection is closed!
happens:
java.lang.AssertionError: expectation "expectError(Class)" failed (expected error of type: MyException; actual type: java.lang.RuntimeException: Async resource cleanup failed after onComplete)
at reactor.test.ErrorFormatter.assertionError(ErrorFormatter.java:105)
at reactor.test.ErrorFormatter.failPrefix(ErrorFormatter.java:94)
at reactor.test.ErrorFormatter.fail(ErrorFormatter.java:64)
at reactor.test.ErrorFormatter.failOptional(ErrorFormatter.java:79)
at reactor.test.DefaultStepVerifierBuilder.lambda$expectError$6(DefaultStepVerifierBuilder.java:357)
at reactor.test.DefaultStepVerifierBuilder$SignalEvent.test(DefaultStepVerifierBuilder.java:2112)
at reactor.test.DefaultStepVerifierBuilder$DefaultVerifySubscriber.onSignal(DefaultStepVerifierBuilder.java:1408)
at reactor.test.DefaultStepVerifierBuilder$DefaultVerifySubscriber.onExpectation(DefaultStepVerifierBuilder.java:1356)
at reactor.test.DefaultStepVerifierBuilder$DefaultVerifySubscriber.onError(DefaultStepVerifierBuilder.java:1030)
at reactor.core.publisher.FluxContextStart$ContextStartSubscriber.onError(FluxContextStart.java:117)
at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.deferredError(FluxUsingWhen.java:397)
at reactor.core.publisher.FluxUsingWhen$CommitInner.onError(FluxUsingWhen.java:520)
...
at reactor.netty.channel.ChannelOperations.onInboundNext(ChannelOperations.java:310)
at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:141)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:648)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:583)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:500)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
at java.lang.Thread.run(Thread.java:748)
Suppressed: java.lang.RuntimeException: Async resource cleanup failed after onComplete
at reactor.core.publisher.FluxUsingWhen$CommitInner.onError(FluxUsingWhen.java:519)
... 129 more
Caused by: java.lang.IllegalStateException: Connection is closed!
at org.springframework.data.r2dbc.function.connectionfactory.SingletonConnectionFactory.create(SingletonConnectionFactory.java:54)
at org.springframework.data.r2dbc.function.DefaultTransactionalDatabaseClient.lambda$cleanup$7(DefaultTransactionalDatabaseClient.java:142)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:118)
... 128 more
Process finished with exit code -1
from spring-data-r2dbc.
Thanks a lot, I'll have a look.
from spring-data-r2dbc.
The initial trace results in unexpected behavior of our resource cleanup. The cleanup happens twice and that's why the refCounter in the bound connection factory is decremented twice. This results in prematurely closing the connection. Analysis ongoing.
from spring-data-r2dbc.
Related Issues (20)
- Upgrade to Maven Wrapper 3.9.4
- Release 1.5.16 (2021.2.16)
- Release 1.5.17 (2021.2.17)
- Model entity need to add custom Encryption on insert/update and decrypt on read HOT 4
- Upgrade to Maven Wrapper 3.9.5
- Release 1.5.18 (2021.2.18)
- Enum is not properly mapped until custom converter created HOT 5
- NativeParameterUtils doesn't support collection with nullable values HOT 7
- Issue with @Transient HOT 3
- Manage transaction name when use @Transactional annotatnion HOT 1
- Transaction rollback does not work when using jOOQ HOT 1
- Custom converter in R2dbcEntityOperations breaks nested mappings
- Caused by: io.r2dbc.postgresql.ExceptionFactory$PostgresqlBadGrammarException: [42883] operator does not exist: traffic_type = character varying
- ConditionalGenericConverter is not properly handled by Spring Data R2DBC HOT 1
- Save entity with custom UUID identifier HOT 2
- `bindProperties` throws error when entities contain enum fields HOT 1
- IN clause not working HOT 4
- `findAllByxxx` incorrectly returns a single object instead of an Iterable. HOT 1
- Unexpected behaviour when using repository saveAll() in WebFilter with response body HOT 3
- java.lang.IllegalStateException: Required property not found for class HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-data-r2dbc.