Log rotation is not thread safe

Bug #1110643 reported by Jerry Seutter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Client
Invalid
Medium
Thomas Herve

Bug Description

tl;dr - use callFromThread in log rotate signal handler code.

The signal handler that reopens log files is not thread safe.

X had a computer where the landscape manager was unresponsive. strace showed that the process was waiting on some sort of lock. Efforts to diagnose the problem further were inconclusive. One other symptom was that there was only one log created after log rotation. For instance, even though the broker was running and responsive, it was no longer logging to the filesystem.

This bug points out that rotating log files in one thread while another thread tries to log something can create a lock race condition: https://bugs.launchpad.net/launchpad/+bug/861742

The client might have this same condition. It has a signal handler that is triggered by a signal from logrotate, which then reopens the log file. It is unclear to me if this runs in a separate thread or not from the rest of the code, due to it being Twisted code. At any rate, callFromThread can be used to ensure that the log file rotation occurs in the same thread as the rest of the client code.

tags: removed: kanban
Changed in landscape-client:
milestone: none → backlog
Thomas Herve (therve)
Changed in landscape-client:
milestone: backlog → 13.02
assignee: nobody → Thomas Herve (therve)
Changed in landscape-client:
milestone: 13.02 → 13.03
Changed in landscape-client:
milestone: 13.03 → 13.04
Changed in landscape-client:
milestone: 13.04 → 13.05
Changed in landscape-client:
milestone: 13.05 → 13.06
Changed in landscape-client:
milestone: 13.06 → 13.07
Changed in landscape-client:
milestone: 13.07 → 13.08
Changed in landscape-client:
milestone: 13.08 → 13.09
Changed in landscape-client:
milestone: 13.09 → 13.09.1
Changed in landscape-client:
milestone: 13.09.1 → 13.10
Changed in landscape-client:
milestone: 13.10 → 13.11
Changed in landscape-client:
milestone: 13.11 → 13.12
Changed in landscape-client:
milestone: 13.12 → 14.01
Changed in landscape-client:
milestone: 14.01 → 14.02
Changed in landscape-client:
milestone: 14.02 → 14.03
Changed in landscape-client:
milestone: 14.03 → 14.04
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

This bug has not seen any activity in the last 6 months, so it is being automatically closed.

If you are still experiencing this issue, please feel free to re-open.

Landscape Team

Changed in landscape-client:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.