Use inotify instead of polling in Runner.py

Bug #558279 reported by tsmetana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Mailman
New
Undecided
Unassigned

Bug Description

Hi,
  the Mailman wakes up 7 times per second which is somehow resource unfriendly. This is caused by qrunners that poll for new files in queue directory. The proposed patch replaces polling in Runner.py with inotify which enables CPU to idle when possible.

The patch requires python-inotify (http://pyinotify.sourceforge.net) to be installed.
--ts

Revision history for this message
bwarsaw (bwarsaw) wrote :

Logged In: YES
user_id=12800
Originator: NO

IIUC, inotify is a Linux-only thing so this would have to be optional. I haven't looked at the patch, but I would target this for Mailman 3 instead of 2.2.

Revision history for this message
tsmetana (tsmetana) wrote :

Logged In: YES
user_id=1869522
Originator: YES

Yes, you're right... I didn't realize that inotify is Linux specific. I will add a configure script option -- this should solve the Linux-only problem and make the python-inotify dependency optional. Also I will take a look at Mailman 3 and try to create a patch for it as well.

Revision history for this message
tsmetana (tsmetana) wrote :

Logged In: YES
user_id=1869522
Originator: YES

File Added: mailman-inotify.patch

Revision history for this message
tsmetana (tsmetana) wrote :

Logged In: YES
user_id=1869522
Originator: YES

I'm adding updated patch for Mailman 2.2 and a new patch for Mailman 3. I've moved the python-inotify parts in conditionals, so if inotify is not present in the system, everything should work as in the unpatched version.
File Added: mailman3-inotify.patch

Revision history for this message
tsmetana (tsmetana) wrote :

Logged In: YES
user_id=1869522
Originator: YES

The patches will make Mailman working but unstoppable. It looks to be a python's problem with handling signals in threads. I'm closing this ticket until the issues got solved.

Revision history for this message
tsmetana (tsmetana) wrote :

Logged In: YES
user_id=1869522
Originator: YES

Reopening: I have prepared new patches that were tested with Mailman 2 and look to be OK. Please consider incorporating the patches.
File Added: mailman3-inotify.patch

Revision history for this message
tsmetana (tsmetana) wrote :

The file mailman3-inotify.patch was added: New patch for Mailman 3

Revision history for this message
tsmetana (tsmetana) wrote :

Logged In: YES
user_id=1869522
Originator: YES

File Added: mailman-inotify.patch

Revision history for this message
tsmetana (tsmetana) wrote :

The file mailman-inotify.patch was added: New patch for Mailman 2

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.