|
We need to do the following:
- Install the general event handler
- When we receive WT_EVENT_CONN_READY , we can safely have FTDC collect WT statistics, but only statistics cursors.
- When we receive the WT_EVENT_CONN_CLOSE, wait for WT_EVENT_CONN_READY again, and then we can safely collect metrics until WT_EVENT_CONN_CLOSE is signaled again.
When receiving a WT_EVENT_CONN_CLOSE it is an indication the connection is about to become invalid so the callback must signal the thread collecting statistics (or otherwise using the connection) to stop using WT and invalidate its session/connection. The callback must not return to WT until the application has completed using the connection. But it does need to return to WT so that closing can continue. If/When you get another WT_EVENT_CONN_READY it is safe to collect again.
|