mirror of
https://github.com/ceph/ceph
synced 2025-04-01 00:26:47 +00:00
debug: ensure a SIGHUP reopens log reasonably soon
Since nothing new may be written to the log for a while, check if it needs to be reopened in the mds/osd/mon tick() method.
This commit is contained in:
parent
843c598e8b
commit
e2389c5316
@ -24,6 +24,12 @@ extern void _dout_open_log();
|
||||
extern int _dout_rename_output_file(); // after calling daemon()
|
||||
extern int _dout_create_courtesy_output_symlink(const char *type, int n);
|
||||
|
||||
static inline void _dout_check_log() {
|
||||
_dout_lock.Lock();
|
||||
if (_dout_need_open)
|
||||
_dout_open_log();
|
||||
_dout_lock.Unlock();
|
||||
}
|
||||
|
||||
static inline void _dout_begin_line() {
|
||||
_dout_lock.Lock();
|
||||
|
@ -384,6 +384,8 @@ void MDS::tick()
|
||||
// reschedule
|
||||
reset_tick();
|
||||
|
||||
_dout_check_log();
|
||||
|
||||
logclient.send_log();
|
||||
|
||||
if (laggy)
|
||||
|
@ -505,6 +505,8 @@ void Monitor::tick()
|
||||
{
|
||||
tick_timer = 0;
|
||||
|
||||
_dout_check_log();
|
||||
|
||||
// ok go.
|
||||
dout(11) << "tick" << dendl;
|
||||
|
||||
|
@ -1083,6 +1083,8 @@ void OSD::tick()
|
||||
assert(osd_lock.is_locked());
|
||||
dout(5) << "tick" << dendl;
|
||||
|
||||
_dout_check_log();
|
||||
|
||||
if (got_sigterm) {
|
||||
dout(0) << "got SIGTERM, shutting down" << dendl;
|
||||
messenger->send_message(new MGenericMessage(CEPH_MSG_SHUTDOWN),
|
||||
|
Loading…
Reference in New Issue
Block a user