-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
@JsonTypeInfo non-deterministically ignored in 2.5.1 #738
Comments
cc #709 |
I am investigating possible cause, related to #735 -- speculating that perhaps inappropriate caching could lead to this problem. This sounds plausible given that #735 also started in 2.4.4. Similar fix is also merge in 2.5 (to be included in 2.5.2), but I want to add more testing for |
I'm seeing it in 2.5.1, 2.5.0, and 2.5.0-rc1, but not any of 2.4.5, 2.4.4, or 2.4.3. |
Looks like test can be further simplified: mix-in is not necessary, and can remove alternate sub-classes. Seems to also fail relatively fast, if at all. |
Ok. I was able to figure out a place in code where additional synchronization can prevent the failure. Nonetheless due to severity of the problem, and since fix does work for the test case given (with longer run times; compared to regularly failing without sync block), and since there should not be much actually harm (code should not be called often once caching takes effect), I think I will add the fix/work-around, get 2.5.2 released, and just keep this in mind for future. |
+1 I'm able to reproduce this issue in our test environment with version 2.5.1. |
@alexo 2.5.3 is the latest released version from 2.5.x branch, so you should be able to upgrade. |
@cowtowncoder thanks! |
We're observing what appears to be a race condition in Jackson 2.5.1, where a particular use of
@JsonTypeInfo
will non-deterministically get ignored when writing JSON. I have a small test case which for me reproduces the issue 30-50% of the time. We're copying the structure of a type in our application, which looks like the following:We mixin
AbstractHasSubTypes
' annotations withHasSubTypes
, and then serialize aWrapper
object which has a single field of typeHasSubTypes
. There appears to be a race condition when serializing these wrapper objects in parallel, where some percentage of the time the@JsonTypeInfo
information is completely ignored and we don't serialize any type information. The linked test case should hopefully make this clearer, it's pretty small. This issue does not appear to affect 2.4.3.The text was updated successfully, but these errors were encountered: