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

strange concurrency bug #709

Closed
wants to merge 1 commit into from
Closed

strange concurrency bug #709

wants to merge 1 commit into from

Conversation

twillouer
Copy link

Hi,

I have a very strange concurrency bug.

When I use @JsonTypeInfo, in a wrapper class, sometimes, the property disapear !
If I doesn't use the wrapped class, all is fine.

If I put only one thread (Executors.newFixedThreadPool(1);), all is fine.

If I use ObjectWritter (like line who is commented), all is fine.

But in this configuration, there a concurrency issue and the "type" information is lost :-/

I make a huge usage of "jongo" and this concurrency problem appears a lot in my unit test.

Can you help me ?

@twillouer
Copy link
Author

And if I uncomment the line 92 (and keep line 102 commented), all is fine again.

@cowtowncoder
Copy link
Member

That certainly sounds unusual, and not something I have seen before. Last concurrency bugs fixed were somewhere in 1.8 or so...

@twillouer
Copy link
Author

Hi,

I cherry-pick my commit and backport to jackson-databind2.2, 2.3, 2.4 and all is fine.

in 2.5.0, the bug occurred.

@cowtowncoder
Copy link
Member

Thank you for the test; I hope to have a look at this soon. Concurrency bugs are certainly not acceptable. I wonder if it could be related to caching changes.

@cowtowncoder
Copy link
Member

As per my notes on #738, I suspect this is related to #735, and caused by improper caching.
Initial fix is included in jackson-databind (micro)path 2.4.5.1, as well as in 2.5 branch (2.5.2-SNAPSHOT). I am not confident this is yet the full fix however.

@cowtowncoder
Copy link
Member

Looking at the test, couple of thoughts:

  1. May not be directly related to @JsonDeserialize on Map with contentUsing custom deserializer overwrites default behavior #735 or @JsonTypeInfo non-deterministically ignored in 2.5.1 #738, since this is for serialization, not deserialization
  2. Use of ObjectWriter may work around the issue because it will (by default) eagerly fetch JsonSerializer to use, and avoid either concurrency issue, or ordering issue, whichever triggers the problem
  3. This may still be due to caching.

I will use the test, just need to figure out proper way to backport as I want to use the test for 2.5 branch at least.

@cowtowncoder
Copy link
Member

Ok. Having worked on #738, I suspect these two are the same. Since this is a PR, #738 issue, I'll close this as dup, leave other open until fix which should occur soon.

@twillouer twillouer deleted the strange-concurrency-issue branch March 28, 2015 23:46
@twillouer
Copy link
Author

works now, thanks !

@cowtowncoder cowtowncoder added this to the 2.5.2 milestone Jun 4, 2015
@cowtowncoder
Copy link
Member

@twillouer thank you for verifying this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants