File tree Expand file tree Collapse file tree 4 files changed +18
-0
lines changed
Expand file tree Collapse file tree 4 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ class BOOST_SYMBOL_VISIBLE IPlugin {
3838 // / needed.
3939 virtual bool initialize () = 0;
4040
41+ // / Called on chunkserver reload to refresh plugin configuration parameters.
42+ virtual void reload () = 0;
43+
4144 // / Returns the plugin name
4245 virtual std::string name () = 0;
4346 // / Returns the plugin version
Original file line number Diff line number Diff line change @@ -118,6 +118,15 @@ bool PluginManager::checkVersion(IPlugin *plugin) {
118118 return false ;
119119}
120120
121+ void PluginManager::reloadPlugins () {
122+ for (auto &[name, plugin] : diskPlugins_) {
123+ if (plugin) {
124+ safs::log_info (" Reloading plugin {}" , plugin->toString ());
125+ plugin->reload ();
126+ }
127+ }
128+ }
129+
121130void PluginManager::cleanupPlugins () {
122131 for (auto &[name, plugin] : diskPlugins_) {
123132 if (plugin) {
Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ class PluginManager {
4949 // / True if this plugin manager can handle the plugin based on the version.
5050 bool checkVersion (IPlugin *plugin);
5151
52+ // / Reload plugins options for all the needed plugins.
53+ void reloadPlugins ();
54+
5255 // / Cleanup resources for all the needed plugins.
5356 void cleanupPlugins ();
5457
Original file line number Diff line number Diff line change @@ -2845,6 +2845,9 @@ void hddReload(void) {
28452845 } catch (const Exception& ex) {
28462846 safs_pretty_syslog (LOG_ERR, " %s" , ex.what ());
28472847 }
2848+
2849+ // Request plugins to reload
2850+ pluginManager.reloadPlugins ();
28482851}
28492852
28502853int hddLateInit () {
You can’t perform that action at this time.
0 commit comments