}
f.close_section();
} else if (what.substr(0, 6) == "config") {
+ // We make a copy of the global config to avoid printing
+ // to py formater (which may drop-take GIL) while holding
+ // the global config lock, which might deadlock with other
+ // thread that is holding the GIL and acquiring the global
+ // config lock.
+ ConfigProxy config{g_conf()};
if (what == "config_options") {
- g_conf().config_options(&f);
+ config.config_options(&f);
} else if (what == "config") {
- g_conf().show_config(&f);
+ config.show_config(&f);
}
} else if (what == "mon_map") {
without_gil_t no_gil;