-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
IllegalReferenceCountException happens when the operation was canceled #22594
Comments
Aside from wrapping the error in something with a more helpful message, I just don't see what eles we can do. |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
Experimenting with something like this: class LeakTests extends AbstractDataBufferAllocatingTests {
@ParameterizedDataBufferAllocatingTest
void byteCountsAndPositions(String displayName, DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;
try {
Flux.range(1, 10)
.doOnNext(i -> {
if (i == 8) {
throw new IllegalStateException("boo");
}
})
.map(i -> bufferFactory.allocateBuffer())
.collectList()
.doOnDiscard(PooledDataBuffer.class, dataBuffer -> {
DataBufferUtils.release(dataBuffer);
dataBuffer.release();
})
.block();
}
catch (Exception ex) {
// Ignore
}
}
} I see that
So in the very least we can avoid the unnecessary stack trace and print a shorter message. |
On closer look this is a bigger issue than just logging. Aside from causing code that shouldn't fail, it places like this can also cause other cleanup to not be performed. |
@rstoyanchev Can 2d8b2fe be backported to 5.2.x? |
This is a follow up to #22384
The following exception is observed
The cause is the following:
https://github.com/spring-projects/spring-framework/blob/master/spring-core/src/main/java/org/springframework/core/codec/AbstractDataBufferDecoder.java#L67
DataBufferUtils.join(InputStream)
declaresdoOnDiscard
, when such event happens the buffer will be recycled then when theStringDecoder
tries to do the actual decoding the exception above will be observedhttps://github.com/spring-projects/spring-framework/blob/master/spring-core/src/main/java/org/springframework/core/codec/StringDecoder.java#L207
The text was updated successfully, but these errors were encountered: