-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Jackson should use HybridJacksonPool #39739
Conversation
f361170
to
dfb2cc1
Compare
@mariofusco the problem here seems related https://github.com/FasterXML/jackson-core/blob/b8a132eefe3ccdcccfe4af444c1c3d237211fd1b/src/main/java/com/fasterxml/jackson/core/util/JsonRecyclerPools.java#L29 which create a whole new pool, meaning that the condition to verify if the user have configured the default "type" is always @geoand wdyt? |
dfb2cc1
to
ed57dc2
Compare
Seems reasonable to me |
@mariofusco @geoand I have found this -> FasterXML/jackson-module-scala#672 (comment) and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's ok for me as a temporary workaround, but in reality the problem should be fixed in jackson-core
that when returning the defaultPool()
should actually return the shared one instead of creating a new pool each and every time.
I will send a pull request to jackson-core
to fix this problem, but when the change will be included in a stable release, and we will upgrade to it, I believe we should also revert this fix otherwise if jackson will decide to change the default pool with a different implementation we will break our integration again.
ed57dc2
to
3b7d5c3
Compare
Agree, although, if users set a different instance of still that specific pool I would feel safer by NOT using it, given that is dangerous even for the non virtual thread use case ie after 3 attempts to compare and set a recycler, it will create a whole new one (!), which is not what we want regardless. |
As anticipated I sent this pull request to jackson that should fix the problem. |
after speaking with @mariofusco I agree on the fact that we cannot save users which want to shoot themselves in the foot ie this PR is just a workaround, which prevent users which use the "wrong" pool type to do it, so, in theory it would be better to wait for the actual fix or merge this in meantime, depending by the time required by jackson to keep up (and us to use it). @geoand |
👌 |
This comment has been minimized.
This comment has been minimized.
@geoand it seems that Jackson's maintainers don't agree with the change I proposed to avoid creating a new pool at each and every incocation of the |
Understood, thanks |
Mind rebasing onto |
3b7d5c3
to
982fdb8
Compare
@geoand @gsmet I don't remember this by heart, but if the existing code path is taken regardless the JDK version in use or if we use |
Status for workflow
|
HybridJacksonPool
with Loom #39738