EMA Java user dispatcher thread deadlock
I'm using ema-3.5.0.1.jar with user dispatch mode.
The application sometimes deadlocks when it starts up. The deadlock comes from dispatcher threads. How long would it take to fix it? Is there a workaround? Below is the thread dump of relevant threads
"dispatcher-0" - Thread t@56
java.lang.Thread.State: WAITING
at java.base@11/jdk.internal.misc.Unsafe.park(Native Method)
- waiting to lock <79b42f53> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) owned by "dispatcher-2" t@60
at java.base@11/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
at java.base@11/java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:885)
at java.base@11/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:917)
at java.base@11/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1240)
at java.base@11/java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:267)
at app//com.thomsonreuters.upa.valueadd.reactor.Reactor.submitChannel(Reactor.java:1989)
at app//com.thomsonreuters.upa.valueadd.reactor.WlStream.encodeIntoBufferAndWrite(WlStream.java:748)
at app//com.thomsonreuters.upa.valueadd.reactor.WlStream.sendCloseMsg(WlStream.java:793)
at app//com.thomsonreuters.upa.valueadd.reactor.WlStream.timeout(WlStream.java:305)
at app//com.thomsonreuters.upa.valueadd.reactor.Watchlist.timeout(Watchlist.java:328)
at app//com.thomsonreuters.upa.valueadd.reactor.Reactor.processWorkerEvent(Reactor.java:2681)
at app//com.thomsonreuters.upa.valueadd.reactor.Reactor.dispatchChannel(Reactor.java:1972)
at app//com.thomsonreuters.upa.valueadd.reactor.ReactorChannel.dispatch(ReactorChannel.java:559)
at app//com.thomsonreuters.ema.access.OmmBaseImpl.rsslReactorDispatchLoop(OmmBaseImpl.java:1336)
at app//com.thomsonreuters.ema.access.OmmBaseImpl.dispatch(OmmBaseImpl.java:598)
at app//com.thomsonreuters.ema.access.OmmConsumerImpl.dispatch(OmmConsumerImpl.java:185)
at app//...
at java.base@11/java.lang.Thread.run(Thread.java:834)
Locked ownable synchronizers:
- locked <1e9a6ed3> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
- locked <60869d82> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
- locked <9440f7d> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
"dispatcher-2" - Thread t@60
java.lang.Thread.State: WAITING
at java.base@11/jdk.internal.misc.Unsafe.park(Native Method)
- waiting to lock <1e9a6ed3> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) owned by "dispatcher-0" t@56
at java.base@11/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
at java.base@11/java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:885)
at java.base@11/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:917)
at java.base@11/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1240)
at java.base@11/java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:267)
at app//com.thomsonreuters.upa.valueadd.reactor.Reactor.submitChannel(Reactor.java:1989)
at app//com.thomsonreuters.upa.valueadd.reactor.WlStream.encodeIntoBufferAndWrite(WlStream.java:748)
at app//com.thomsonreuters.upa.valueadd.reactor.WlStream.sendCloseMsg(WlStream.java:793)
at app//com.thomsonreuters.upa.valueadd.reactor.WlStream.timeout(WlStream.java:305)
at app//com.thomsonreuters.upa.valueadd.reactor.Watchlist.timeout(Watchlist.java:328)
at app//com.thomsonreuters.upa.valueadd.reactor.Reactor.processWorkerEvent(Reactor.java:2681)
at app//com.thomsonreuters.upa.valueadd.reactor.Reactor.dispatchChannel(Reactor.java:1972)
at app//com.thomsonreuters.upa.valueadd.reactor.ReactorChannel.dispatch(ReactorChannel.java:559)
at app//com.thomsonreuters.ema.access.OmmBaseImpl.rsslReactorDispatchLoop(OmmBaseImpl.java:1336)
at app//com.thomsonreuters.ema.access.OmmBaseImpl.dispatch(OmmBaseImpl.java:598)
at app//com.thomsonreuters.ema.access.OmmConsumerImpl.dispatch(OmmConsumerImpl.java:185)
at app//...
at java.base@11/java.lang.Thread.run(Thread.java:834)
Locked ownable synchronizers:
- locked <79b42f53> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
- locked <75883433> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
- locked <6da685c> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
Answers
-
Hi @ahmire.kailer,
Can you please point us to which EMA sample is causing this issue so the development team can confirm it is an issue within the library? Thanks.
0 -
The code is similar to example130 and example410 combined.
In summary:
- User dispatch mode
- Multiple consumers with the same user name
- Multiple threads calling OmmConsumer.registerClient() (registerClient is never invoked by dispatcher threads, dispatcher threads only decode)
- Long dispatch timeout - OmmConsumer.dispatch(Long.MAX_VALUE) (not sure if this is the best way to wait indefinitely for data, it not please advise)
0 -
Hi @ahmire.kailer,
In order for the development team to fix a problem within the library, they will need to reproduce the error. Because this isn't a specific example they released that is causing an issue, but instead a hybrid example you put together, you will need to provide the example for them to replicate and show it is an issue within the library, not your application. Ideally, if you can narrow down your example to a minimal code segment, this will allow them to determine where the issue is.
The EMA Project has an issue section that will allow you to report your finding within the library within GitHub.
0 -
I tried to reproduce the problem using much simplified code without success. I then downgraded back to ema-3.4.0.1.jar , it hasn't deadlocked so far. I had deadlock problems with 3.4 using API dispatch, there're suggestions that deadlock could be avoided by using user dispatch and it indeed worked. I upgraded to 3.5 last week thinking it would be better. I'll use 3.4 for now. If I manage to come up with a simple example that could reproduce the problem, I'll put it here.
0 -
The issue has been submitted as part of issue #149 on GitHub.1
-
Hello @ahmire.kailer
I found that you have summitted this issue as issue #151 on GitHub. Did you have a chance to test the work around that suggested by the Dev team?
0 -
Hello @ahmire.kailer
I found that you have summitted this issue as issue #151 on GitHub. Did you have a chance to test the work around that suggested by the Dev team?
0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛