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

AbstractCodecConfigurer creates Jackson Encoders/Decoders each time when getters are called [SPR-15816] #20371

Closed
spring-issuemaster opened this issue Jul 25, 2017 · 1 comment

Comments

@spring-issuemaster
Copy link
Collaborator

commented Jul 25, 2017

Babur Duisenov opened SPR-15816 and commented

AbstractCodecConfigurer #getReaders #getWriters methods create new instances of Jackson2JsonDecoder and Jackson2JsonEncoder each time when getters are called, by default.
This happens because of this code:

protected Jackson2JsonEncoder jackson2Encoder() {
     return this.jackson2Encoder != null ? this.jackson2Encoder : new Jackson2JsonEncoder();
}
protected Jackson2JsonDecoder jackson2Decoder() {
     return this.jackson2Decoder != null ? this.jackson2Decoder : new Jackson2JsonDecoder();
}

The Jackson2JsonDecoder and Jackson2JsonEncoder internally are using org.springframework.util.ClassUtils.forName blocking method, which leads to blocking reactor-http-nio threads.


Affects: 5.0 RC2

Attachments:

Issue Links:

  • #20429 BLOCKED "reactor-http-nio-*" threads under load ("is duplicated by")

Referenced from: commits f397577

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 26, 2017

Arjen Poutsma commented

Fixed in f397577

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.