Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • TREP APIs /
  • RFA /
avatar image
Question by Haseuser_deprecated_0 · Mar 23, 2016 at 02:44 AM · rfac++eventqueue

cleanup() halts on rfa::common::EventQueue::destroy()

After RFA C++ modified example StarterConsumer_BatchView has been running for a period of time, cleanup() halts on rfa::common::EventQueue::destroy()

How long does it take to destroy EventQueue? Is there any timeout?

Is there anything I can do to trace the destroy progress?

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 Steven McCoy · Mar 23, 2016 at 09:52 AM

EventQueue::destroy() must not be called until all active streams have been completed. This is why the cleanup() function is organised as follows:

// prevent new events from being added to the queue
_pEventQueue->deactivate();
// destroy all event consumers
...
// finally destroy the event queue
_pEventQueue->destroy();

If all the event consumers have not terminated, or events are being used in multiple threads without synchronisation then the EventQueue::destroy() will exhibit undefined behaviour.

It can be beneficial to wrap RFA objects with smart pointers and check the reference count before attempting to destroy.

assert (event_queue_.use_count() <= 1);
event_queue_.reset();

I also like to use a leak tracker around objects with RFA references to provide useful feedback on the shutdown sequence.

Comment
jirapongse.phuriphanvichai
Jonathan.Haruni.Refinitiv
Haseuser_deprecated_0

People who like this

3 Show 2 · 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
Haseuser_deprecated_0 · Apr 12, 2016 at 11:54 PM 0
Share

This situation is not happening all the time, my test case is the same but it sometimes unexpectedly halts. Will it take time to destroy if the streaming runs for a period of time? e.g. If the streaming has run for a day, it will take 15 minutes to destroy in order to fully exit the program.

avatar image
REFINITIV
Steven McCoy ♦♦ Haseuser_deprecated_0 · Apr 14, 2016 at 10:08 AM 0
Share

@Haseuser destroy will only take time if the application has been a slow consumer and buffered many thousands of messages that each need to be inspected. By monitoring the application memory usage one should be able to determine whether the application has been building up a backlog due to insufficient processing performance.

avatar image
REFINITIV
Answer by jirapongse.phuriphanvichai · Apr 13, 2016 at 04:30 AM

This may relate to the number of remaining events in the event queue and the size of memory used by the application.

From our test, we have modified StarterConsumer to be a slow consumer. Therefore, the number of remaining events in the event queue was around 79000 events and the size of memory was growing to around 6 GB.

When cleaning up, it took around 8 minutes to exit the process.

.....

Dispatch Return: 79878

Dispatch Return: 79877

Dispatch Return: 79876

Dispatch Return: 79875

********************** INFO ************************ INFO **********************

2016 Apr 13 14:44:44.934 ST GMT+07:00 2634 26FC 332 INFO

StarterConsumer Aborted (Control C) after attempting to dispatch msgs for 14

2 seconds

Exiting!.

2016 Apr 13 14:44:53.866 ST GMT+07:00 2634 26FC 629 TRACE ::cleanup().

_pEventQueue->deactivate() is called.....##### 7:44:54.198 #####

_pEventQueue->deactivate() return.....##### 7:44:54.216 #####

_pEventQueue->destroy(); is called.....##### 7:45:22.601 #####

_pEventQueue->destroy();return........##### 7:48:26.315 #####

Context::uninitialize() is called...##### 7:48:27.529 #####

Context::uninitialize() returns...##### 7:52: 8.271 #####

********************** INFO ************************ INFO **********************

2016 Apr 13 14:52:08.272 ST GMT+07:00 2634 26FC 138 INFO

Exiting StarterConsumer - Closing log file: StarterConsumer_9780.log.

Press any key to continue . . .

......

You may need to verify the total memory used by the application. If it is very high, the application may be a slow consumer and it will take time to clean up.


mem.png (43.8 KiB)
Comment
Haseuser_deprecated_0
Steven McCoy

People who like this

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

Related Questions

RFA EventQueue bottleneck

Bad directory data with multiple clients

Does a completion event close the EventQueue supplied or terminates the consumer, as it were?

RFA decoding payload

Thomson Reuters RFA EventQueue - Log Queue depth - How to log the current queue depth periodically

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • 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
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • 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
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges