Comments (14)
Did you tried with version 1.4.5 ?
from orika.
It's an uncommon error with a race condition, I'm not able to reproduce it so I can't know if it also happens with 1.4.5 or not. Looking at the code in 1.4.5 my impression was that the basic code of that part hadn't been changed. Do you think it could be already fixed in 1.4.5?
from orika.
Yes, you're right thank you for the threadump !
This is related to https://github.com/orika-mapper/orika/blob/master/core/src/main/java/ma/glasnost/orika/impl/DefaultMapperFactory.java#L1501
The lines from 1501 to 1503 should be deleted.
The issue has been fixed for getMapperFacade but not for getMapperFacade(Type sourceType, Type destinationType, boolean containsCycles)
Need to do more test, one more time again thank you :)
from orika.
Hello,
We encounter this problem of deadlock with orika 1.4.5 in our application in production when there is a concurrent initialisation of orika by 2 web requests.
We are correcting it by calling getMapperFacade just before getMapperFacade(Type sourceType, Type destinationType, boolean containsCycles).
Do you think this point will be corrected soon ?
Regards,
from orika.
It's should be fixed in 1.5.0 release
from orika.
Hello,
We have also this problem of deadlock with orika 1.4.2 in our production application, similar problem as cnico.
We have adopted the same solution of calling getMapperFacade just before the other call. It seems to work but we have no real data to certificate it yet, the issue is new. We think it has become a problem as our application has growth in usage, and the probability of concurrent web request is now more likely.
We also have a new version of the application that uses Orika quite heavily, but we have not updated it with the discussed patch, we are waiting to see if the patch corrects the issue in production.
Is there any ETA on the 1.5.0 release? I´ve been looking at the code of the actual 1.5.0 beta, and the problematic code is the same.
Thank you very much
from orika.
So which version has this fix?
In my application, we are seeing the racing thread condition. Here is the call stack. I am using 1.4.6
4XESTACKTRACE at java/util/WeakHashMap.get(WeakHashMap.java:529(Compiled Code))
4XESTACKTRACE at ma/glasnost/orika/metadata/TypeKey.getTypeIndex(TypeKey.java:37(Compiled Code))
4XESTACKTRACE at ma/glasnost/orika/metadata/TypeKey.valueOf(TypeKey.java:79(Compiled Code))
4XESTACKTRACE at ma/glasnost/orika/metadata/TypeFactory.intern(TypeFactory.java:80(Compiled Code))
4XESTACKTRACE at ma/glasnost/orika/metadata/TypeFactory.valueOf(TypeFactory.java:143(Compiled Code))
4XESTACKTRACE at ma/glasnost/orika/metadata/TypeFactory.valueOf(TypeFactory.java:348(Compiled Code))
4XESTACKTRACE at ma/glasnost/orika/CustomConverter.(CustomConverter.java:49(Compiled Code))
4XESTACKTRACE at ma/glasnost/orika/converter/builtin/BuiltinBidirectionalConverter.(BuiltinBidirectionalConverter.java:36(Compiled Code))
4XESTACKTRACE at ma/glasnost/orika/converter/builtin/BuiltinConverters.register(BuiltinConverters.java:127)
4XESTACKTRACE at ma/glasnost/orika/impl/DefaultMapperFactory.build(DefaultMapperFactory.java:1185(Compiled Code))
5XESTACKTRACE (entered lock: ma/glasnost/orika/impl/DefaultMapperFactory@0x00000000B384A090, entry count: 1)
4XESTACKTRACE at ma/glasnost/orika/impl/DefaultMapperFactory.getMapperFacade(DefaultMapperFactory.java:1502(Compiled Code))
4XESTACKTRACE at ma/glasnost/orika/impl/DefaultMapperFactory.getMapperFacade(DefaultMapperFactory.java:1490(Compiled Code))
4XESTACKTRACE at ma/glasnost/orika/impl/DefaultMapperFactory.getMapperFacade(DefaultMapperFactory.java:1516)
from orika.
Try with 1.5.0 or 1.5.1
from orika.
Is it fixed in 1.5.0?
from orika.
You have to try it, because it's not easy to reproduce.
from orika.
Hello.
I've faced lock issue on 1.5.1
I'm not sure it's same reason or not, but let me report.
I've already use orika in long time. It was first time. So I guess it's very rare case.
java.lang.Thread.State: BLOCKED (on object monitor)
at ma.glasnost.orika.impl.DefaultMapperFactory.lookupMapper(DefaultMapperFactory.java:708)
- waiting to lock <0x00000003c1d570a0> (a ma.glasnost.orika.impl.DefaultMapperFactory)
at ma.glasnost.orika.impl.MapperFacadeImpl.resolveMapper(MapperFacadeImpl.java:567)
at ma.glasnost.orika.impl.MapperFacadeImpl.resolveMappingStrategy(MapperFacadeImpl.java:179)
at ma.glasnost.orika.impl.MapperFacadeImpl.mapElement(MapperFacadeImpl.java:790)
at ma.glasnost.orika.impl.MapperFacadeImpl.mapAsCollection(MapperFacadeImpl.java:621)
at ma.glasnost.orika.impl.MapperFacadeImpl.mapAsList(MapperFacadeImpl.java:427)
java.lang.Thread.State: BLOCKED (on object monitor)
at ma.glasnost.orika.impl.DefaultBoundMapperFacade$BoundStrategyCache.getStrategy(DefaultBoundMapperFacade.java:257)
- waiting to lock <0x00000003c1d7cd98> (a ma.glasnost.orika.impl.DefaultBoundMapperFacade$BoundStrategyCache)
at ma.glasnost.orika.impl.DefaultBoundMapperFacade.mapReverse(DefaultBoundMapperFacade.java:152)
at ma.glasnost.orika.generated.Orika_OptionRate_OptionRate_Mapper3647891352978001$12.mapBtoA(Orika_OptionRate_OptionRate_Mapper3647891352978001$12.java)
at ma.glasnost.orika.impl.ReversedMapper.mapAtoB(ReversedMapper.java:65)
at ma.glasnost.orika.impl.mapping.strategy.UseCustomMapperStrategy.map(UseCustomMapperStrategy.java:77)
at ma.glasnost.orika.impl.MapperFacadeImpl.map(MapperFacadeImpl.java:254)
at ma.glasnost.orika.impl.MapperFacadeImpl.mapElement(MapperFacadeImpl.java:797)
at ma.glasnost.orika.impl.MapperFacadeImpl.mapAsCollection(MapperFacadeImpl.java:621)
at ma.glasnost.orika.impl.MapperFacadeImpl.mapAsList(MapperFacadeImpl.java:419)
at ma.glasnost.orika.impl.MapperFacadeImpl.mapAsList(MapperFacadeImpl.java:706)
at ma.glasnost.orika.impl.ConfigurableMapper.mapAsList(ConfigurableMapper.java:198)
from orika.
I had same lock issue again, on 1.5.1
It looks... this thread made lock
"ajp-nio-18009-exec-11" #184 daemon prio=5 os_prio=0 tid=0x00007f1504001800 nid=0x8256 runnable [0x00007f14eaff5000]
java.lang.Thread.State: RUNNABLE
at java.util.WeakHashMap.get(WeakHashMap.java:403)
at ma.glasnost.orika.metadata.TypeKey.getTypeIndex(TypeKey.java:55)
at ma.glasnost.orika.metadata.TypeKey.valueOf(TypeKey.java:47)
at ma.glasnost.orika.metadata.TypeFactory.intern(TypeFactory.java:437)
at ma.glasnost.orika.metadata.TypeFactory.valueOf(TypeFactory.java:69)
at ma.glasnost.orika.property.PropertyResolver.resolvePropertyType(PropertyResolver.java:340)
at ma.glasnost.orika.property.PropertyResolver.processProperty(PropertyResolver.java:265)
at ma.glasnost.orika.property.IntrospectorPropertyResolver.collectProperties(IntrospectorPropertyResolver.java:105)
at ma.glasnost.orika.property.PropertyResolver.getProperties(PropertyResolver.java:128)
- locked <0x00000003c7c9f7c8> (a ma.glasnost.orika.metadata.Type)
at ma.glasnost.orika.metadata.ClassMapBuilder.<init>(ClassMapBuilder.java:123)
at ma.glasnost.orika.metadata.ClassMapBuilder$Factory.newClassMapBuilder(ClassMapBuilder.java:70)
at ma.glasnost.orika.metadata.ClassMapBuilderFactory.getNewClassMapBuilder(ClassMapBuilderFactory.java:142)
- locked <0x00000003c2ace720> (a ma.glasnost.orika.metadata.ClassMapBuilder$Factory)
at ma.glasnost.orika.metadata.ClassMapBuilderFactory.map(ClassMapBuilderFactory.java:153)
at ma.glasnost.orika.impl.DefaultMapperFactory.classMap(DefaultMapperFactory.java:1564)
at ma.glasnost.orika.impl.DefaultMapperFactory.lookupMapper(DefaultMapperFactory.java:733)
- locked <0x00000003c19fffc8> (a ma.glasnost.orika.impl.DefaultMapperFactory)
at ma.glasnost.orika.impl.MapperFacadeImpl.resolveMapper(MapperFacadeImpl.java:567)
at ma.glasnost.orika.impl.MapperFacadeImpl.resolveMappingStrategy(MapperFacadeImpl.java:179)
at ma.glasnost.orika.impl.MapperFacadeImpl.mapElement(MapperFacadeImpl.java:790)
at ma.glasnost.orika.impl.MapperFacadeImpl.mapAsCollection(MapperFacadeImpl.java:621)
at ma.glasnost.orika.impl.MapperFacadeImpl.mapAsList(MapperFacadeImpl.java:427)
and other threads are blocked.
"ajp-nio-18009-exec-12" #242 daemon prio=5 os_prio=0 tid=0x00007f1504007800 nid=0x86e5 waiting for monitor entry [0x00007f14eb9fb000]
java.lang.Thread.State: BLOCKED (on object monitor)
at ma.glasnost.orika.impl.DefaultMapperFactory.lookupMapper(DefaultMapperFactory.java:708)
- waiting to lock <0x00000003c19fffc8> (a ma.glasnost.orika.impl.DefaultMapperFactory)
at ma.glasnost.orika.impl.MapperFacadeImpl.resolveMapper(MapperFacadeImpl.java:567)
at ma.glasnost.orika.impl.MapperFacadeImpl.resolveMappingStrategy(MapperFacadeImpl.java:179)
It looks similar with above comment by Mr. / Ms. deba70,
the locking thread was on the WeakHashMap.
I found this issue looks fixed on 1.5.2. I'll use the latest version.
from orika.
We are seeing this issue with 1.4.6 too. will try updating the orika version.
from orika.
I am seeing this issue with 1.5.2 too.
the thread dump:
"http-nio-8080-exec-298" #5198 daemon prio=5 os_prio=0 tid=0x00007fc5d40ba800 nid=0x154a waiting on condition [0x00007fc55bbf7000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park([email protected]/Native Method)
- parking to wait for <0x0000000745b20518> (a java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync)
at java.util.concurrent.locks.LockSupport.park([email protected]/LockSupport.java:194)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt([email protected]/AbstractQueuedSynchronizer.java:883)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireShared([email protected]/AbstractQueuedSynchronizer.java:1007)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShared([email protected]/AbstractQueuedSynchronizer.java:1322)
at java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lock([email protected]/ReentrantReadWriteLock.java:738)
at ma.glasnost.orika.util.SortedCollection.iterator(SortedCollection.java:177)
at ma.glasnost.orika.impl.DefaultMapperFactory.getRegisteredMapper(DefaultMapperFactory.java:805)
at ma.glasnost.orika.impl.DefaultMapperFactory.lookupMapper(DefaultMapperFactory.java:702)
at ma.glasnost.orika.impl.MapperFacadeImpl.resolveMapper(MapperFacadeImpl.java:567)
at ma.glasnost.orika.impl.MapperFacadeImpl.resolveMappingStrategy(MapperFacadeImpl.java:179)
at ma.glasnost.orika.impl.MapperFacadeImpl.mapElement(MapperFacadeImpl.java:791)
at ma.glasnost.orika.impl.MapperFacadeImpl.mapAsCollection(MapperFacadeImpl.java:621)
at ma.glasnost.orika.impl.MapperFacadeImpl.mapAsSet(MapperFacadeImpl.java:413)
at ma.glasnost.orika.generated.Orika_SigningInfo_Identity_Mapper4916422670605452$4.mapAtoB(Orika_SigningInfo_Identity_Mapper4916422670605452$4.java)
at ma.glasnost.orika.impl.mapping.strategy.UseCustomMapperStrategy.map(UseCustomMapperStrategy.java:77)
at ma.glasnost.orika.impl.MapperFacadeImpl.map(MapperFacadeImpl.java:254)
at ma.glasnost.orika.impl.MapperFacadeImpl.mapElement(MapperFacadeImpl.java:798)
at ma.glasnost.orika.impl.MapperFacadeImpl.mapAsCollection(MapperFacadeImpl.java:621)
at ma.glasnost.orika.impl.MapperFacadeImpl.mapAsList(MapperFacadeImpl.java:419)
at ma.glasnost.orika.impl.MapperFacadeImpl.mapAsList(MapperFacadeImpl.java:706)
from orika.
Related Issues (20)
- Enums which implement methods can't be converted since v1.5.1
- Null Pointer exception during mapping of complex objects HOT 1
- ScoringClassMapBuilder generated the wrong map
- Problems with Java 17 HOT 20
- Orika cannot find correct converter with class type define equals to compare typekey HOT 3
- can not converter source list to destination list with same enum property
- Workaround for multiple CustomConverters with the same (could be anonymous) classes.
- Integer how to map thrift TEnum
- Thank you for replying to the question about converting Java objects from map
- NPE while mapAsList invocation
- bean has list<Map> can't do trans completed! HOT 2
- Wrong ObjectFactory generated when destination object has no args and all args constructor HOT 1
- Provide built-in support for type com.fasterxml.jackson.databind.JsonNode
- Totally remove java-szieof
- Optimize MapperGenerator class so that there will be no method code length limit
- Mapping Member inner class from another simple class not working
- not support jdk17? HOT 9
- 【BUG】Generic object mapping ClassCastException occut.
- Is there gonna be any new release for the Orika core? HOT 1
- Same object with different fields?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orika.