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
REFINITIV
Question by Frederic · Nov 19, 2021 at 03:46 AM · ema-apirrtoc++

RTO EMA C++ consumer destructor 'Segmentation fault (core dumped)'

Considering this code snippet:
1.png

For the destructor method, it got the following 'Segmentation fault (core dumped)' error:

2.png

So the question is

1) is that allow to call the destructor (to cleanup) of the consumer and then create a new one theoretically? And why we see those error?

2) For EMA C++, is that true the handler (onRefreshMsg, onStatusMsg,...,) logic runs in a separate thread other that the 'main' thread?
3) Is there any case that EMA cannot recover the connection and quit the application (even set the attemptLimit = -1)?

4) In the case of Login Stream CLOSED due to some issue, does the application need to destroy the old consumer and create a new one, how to do that in the onStatusMsg method implementation?

1.png (37.9 KiB)
2.png (268.9 KiB)

People who like this

0 Show 0
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.

2 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by umer.nalla · Nov 29, 2021 at 04:43 PM

Hi @Frederic

As per your final question above, on a Force Logout from Dacs where the Login Stream is closed, you would need to delete the OmmConsumer and create again to initiate a new connection + login etc.


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 umer.nalla · Nov 19, 2021 at 09:52 AM

Hi @Frederic

Firstly, I don't understand why the code above is calling the destructor explicitly - I am not a hardcore C++ developer - but I have always been advised that we should never call the destructor explicitly.
I tested an EMA Example on Linux (WSL) and If I call the destructor explicitly as in the code snippet above, I also see a Segmentation fault. If, however, I delete the OmmConsumer instance then I do not see the segmentation fault.

The event handlers do run in a separate thread to the main application thread.

If ReconnectAttemptLimit is set to -1, it should continue to try and connect indefinitely - unless of course, the main() function exits (e.g. in most of the EMA examples we have a 60s time limit).

If the Login Stream is closed then all streams are closed and the connection is closed, so they would need to create a new OmmConsumer. In terms of deleting and creating a new OmmConsmer - this should be down to standard C++ coding and the developer would need to implement the appropriate strategy in their code. For example, the EMA example 410 creates multiple OmmConsumer by creating a separate class called ConsumerManager - so even here the developer could have a separate class that handles creating and deleting an OmmConsumer on demand.




Comment

People who like this

0 Show 3 · 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
Frederic · Nov 19, 2021 at 09:56 AM 0
Share

Thank you for the helpful information, I will have a check

avatar image
REFINITIV
Frederic · Nov 19, 2021 at 10:39 AM 0
Share

In such case of Login Stream closed not intended (maybe due to connection issue?), will the EMA auto recover that?

avatar image
REFINITIV
Frederic · Nov 22, 2021 at 03:37 AM 0
Share

Take the 'Force Logout from DACS' example (https://community.developers.refinitiv.com/questions/87314/rto-force-logout-from-dacs-in-the-ema-login-domain.html), the connection was closed by server.
In such case will the EMA recover the connection? (maybe this question will go to the Reactor implementation)

Or we should delete the consumer then recreate?
(Looks like the client encountered some issue that duplicated messages are received... do not have much detail on that.)

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 >
8 People are following this question.

Related Questions

RTO AWS PrivateLink with EKS container, initialization timeout

RTO EMA C++ application triggered the server overflow condition

Refinitive Realtme SDK 2.0.0 C++ contains only eta binaries, is there any plan to release same version for ema library?

Where can I find sample EMA C++ MRN code for Elektron API 3.1? not in the Elektron-SDK1.1.0.win_0 100-440 examples.

Where to put default [EmaConfig.xml] file for C++ Linux?

  • 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