-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ability to gracefully interrupt application in both fetch and p…
…ull modes (#47) Added custom signal handlers for SIGINT and SIGTERM that set global flag ('std::atomic_flag global_termination_flag' ). Added extra logic that checks for a termination request in the following locations. * Inside receiving / processing individual binlog events loop in 'receive_binlog_events()'. * In the 'pull' mode idle-reconnection loop. * Inside the idle time sleep function. From the user point of view the application can now be gracefully shut down when user presses 'Ctrl+C' or kills the application by SIGTERM (e.g. 'kill <binlog_server_pid>'). "Gracefully " means that all the connections will be properly closed, data caches written to disk / uploaded to the cloud and storage will remain in consistent / resumable state. Because of the synchronous nature of the binlog functions from the MySQL client library, there still may be a delay between receiving the signal and reacting to it. Worst case scenario, user will have to wait '<connection.read_timeout>' (the value from the configuration) + 1 second (the granularity of sleep intervals in the 'idle' mode).
- Loading branch information
1 parent
f0f62ef
commit 0a79d56
Showing
1 changed file
with
87 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters