Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Elektron /
  • EMA /
avatar image
Question by ahmire.kailer · Jul 24, 2020 at 06:02 PM · elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-apijava

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)

People who like this

0 Show 3
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
nick.zincone ♦♦ · Jul 24, 2020 at 08:52 PM 0
Share

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.

avatar image
ahmire.kailer nick.zincone ♦♦ · Jul 27, 2020 at 09:27 AM 0
Share

Hi @nick.zincone.1

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)
avatar image
REFINITIV
wasin.w ♦♦ · Nov 17, 2020 at 02:50 AM 0
Share

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?

3 Replies

  • Sort: 
avatar image
REFINITIV
Answer by nick.zincone · Jul 27, 2020 at 12:40 PM

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.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
Answer by ahmire.kailer · Jul 29, 2020 at 04:00 PM

Hi @nick.zincone.1

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.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by wasin.w · Aug 17, 2020 at 04:30 AM
The issue has been submitted as part of issue #149 on GitHub.
Comment
SupDev1

People who like this

1 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
12 People are following this question.

Related Questions

(JAVA) Does using interestAfterRefresh(false) remove the need for deregistering items with Elektron?

What could cause intermittent "Failed to make subscription" StatusMsg

Vector on EMA

EMA - How do I reset view to get all fields?

FieldEntry copy

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges