-
Notifications
You must be signed in to change notification settings - Fork 481
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
MappedFieldsTracker throws Exceptions #821
Comments
@xiaoxiaoxing ; no, sorry. but looking at the stack, this is the only PR affecting which was released in 6.5.0: can you try 6.4.1? |
Hi, @garethahealy: Yes, I agree with you, I believe the issue is caused by the new transaction feature introduced in 6.5.0, looks like in multi-threads environment, the state of pendingTransactions in MappedFieldsTracker could be messed up. I am able to reproduce the issue by unit test, and when I downgrade to 6.4.0, the issue is gone. Here is my unit test:
Run the above test for a couple times, you would see either IllegalStateException or NPE will be thrown from some of the threads in MappedFieldsTracker. |
Are you in the right place?
Whats your runtime?
Whats the problem?
I am trying to upgrade DozerMapper from5.4 to 6.x, I started to see spike of Exceptions from DozerMapper when deployed the change to production environment. I could not reproduce the issue in our gamma environment by manually triggering some requests. I am not familiar with the DozerMapper implemention, I am wondering do you have any idea what could happen here? Thanks.
There are two types of Exceptions:
Looks like the "No transaction with ID" exception was thrown from pendingTransactions in MappedFieldsTracker, is MappedFieldsTracker a singleton? Is it supposed to be thread safe?
I pasted parts of the logs here:
java.lang.IllegalStateException: No transaction with ID 0 at com.github.dozermapper.core.MappedFieldsTracker.commitTransaction(MappedFieldsTracker.java:99) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.addOrUpdateToList(MappingProcessor.java:901) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.addOrUpdateToList(MappingProcessor.java:961) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.mapListToList(MappingProcessor.java:791) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.mapCollection(MappingProcessor.java:641) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.mapOrRecurseObject(MappingProcessor.java:500) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.mapFromFieldMap(MappingProcessor.java:404) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.mapField(MappingProcessor.java:354) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.map(MappingProcessor.java:314) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.mapToDestObject(MappingProcessor.java:263) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.createByCreationDirectiveAndMap(MappingProcessor.java:236) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.mapGeneral(MappingProcessor.java:209) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.map(MappingProcessor.java:132) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.map(MappingProcessor.java:127) ~[dozer-core-6.5.1.jar:?] at xxxCustomConverter.convert(xxxCustomConverter.java:40) ~[xxxService-1.0.jar:?]
java.lang.NullPointerException: null at com.github.dozermapper.core.MappedFieldsTracker.put(MappedFieldsTracker.java:155) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.map(MappingProcessor.java:273) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.mapToDestObject(MappingProcessor.java:263) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.createByCreationDirectiveAndMap(MappingProcessor.java:236) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.mapCustomObject(MappingProcessor.java:575) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.mapOrRecurseObject(MappingProcessor.java:512) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.addOrUpdateToList(MappingProcessor.java:885) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.addOrUpdateToList(MappingProcessor.java:961) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.mapListToList(MappingProcessor.java:791) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.mapCollection(MappingProcessor.java:641) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.mapOrRecurseObject(MappingProcessor.java:500) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.mapFromFieldMap(MappingProcessor.java:404) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.mapField(MappingProcessor.java:354) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.map(MappingProcessor.java:314) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.mapToDestObject(MappingProcessor.java:263) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.createByCreationDirectiveAndMap(MappingProcessor.java:236) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.mapGeneral(MappingProcessor.java:209) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.map(MappingProcessor.java:132) ~[dozer-core-6.5.1.jar:?] at com.github.dozermapper.core.MappingProcessor.map(MappingProcessor.java:127) ~[dozer-core-6.5.1.jar:?] at xxxCustomConverter.convert(xxxCustomConverter.java:40) ~[xxxService-1.0.jar:?]
Observed Results:
Exceptions from DozerMapper.
Expected Results:
No Exception from DozerMapper.
Link to GitHub repo with Unit test
NA
The text was updated successfully, but these errors were encountered: