IssueDataBuffers are not always properly released when theWebClient is used to deserialize JSON responses with Jackson. This seems to happen in cases of cancellation/timeout. This happens spuriously in our production systems, but I have added a reproduction case below that demonstrates the issue.
This issue (and the reproduction case) is similar to https://github.com/spring-projects/spring-framework/issues/22384, however, since the StringDecoder was being used (which explicitly releases data buffers), the issue in the Jackson2Decoder went unnoticed.
Verified on: 6.2.0-SNAPSHOT (https://github.com/spring-projects/spring-framework/commit/cbdfe815aa3562c6b05c066e6570e59e95c91e61)
Issue
DataBuffer
s are not always properly released when theWebClient
is used to deserialize JSON responses with Jackson. This seems to happen in cases of cancellation/timeout. This happens spuriously in our production systems, but I have added a reproduction case below that demonstrates the issue.This issue (and the reproduction case) is similar to https://github.com/spring-projects/spring-framework/issues/22384, however, since the
StringDecoder
was being used (which explicitly releases data buffers), the issue in theJackson2Decoder
went unnoticed.Reproduction case:
Potential fix:
With the following
diff
the tests pass again. I did not check if e.g.bodyToMono
and/or other decoders are affected.