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?
Best Answer
-
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.
0
Answers
-
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.
0 -
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 142 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 INFOExiting 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.
0 -
@Haseuser_deprecated_0 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.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 687 Datastream
- 1.4K DSS
- 621 Eikon COM
- 5.2K Eikon Data APIs
- 11 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 4 Trading API
- 2.9K Elektron
- 1.4K EMA
- 254 ETA
- 557 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 276 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 669 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 229 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛