path: root/wallace/
diff options
authorJeroen van Meeuwen (Kolab Systems) <>2018-07-27 10:22:18 +0200
committerJeroen van Meeuwen (Kolab Systems) <>2018-07-27 10:22:18 +0200
commit3c5ce19ae3e2b5ed90d0924c89d15f0c7609f53b (patch)
treed3e08b8874fdabfc858633a1ceb9e906ea743a51 /wallace/
parenta1c700d53d8a9b0405f7bc28f835ab5142d0f72d (diff)
Manage the pool processes such that they die after a limited quantity of time, and pick up messages from the spool asynchronously.
Summary: Reference T75735 Let a single worker process timeout itself Set the signal as late as possible Abstract the method to pickup messages from the spool, so that a new recurring Timer may pick up messages out of the spool Test Plan: * Run messages through it Reviewers: #pykolab_developers Subscribers: #pykolab_developers Differential Revision:
Diffstat (limited to 'wallace/')
1 files changed, 7 insertions, 0 deletions
diff --git a/wallace/ b/wallace/
index 962e11a..80c85f1 100644
--- a/wallace/
+++ b/wallace/
@@ -22,6 +22,7 @@ import icalendar
import os
import pytz
import random
+import signal
import tempfile
import time
from urlparse import urlparse
@@ -1355,8 +1356,14 @@ def send_owner_notification(resource, owner, itip_event, success=True):
resource['cn'], participant_status_label(status) if success else _('failed')
+ seed = random.randint(0, 6)
+ alarm_after = (seed * 10) + 60
+ log.debug(_("Set alarm to %s seconds") % (alarm_after), level=8)
+ signal.alarm(alarm_after)
result = modules._sendmail(resource['mail'], owner['mail'], msg.as_string())
log.debug(_("Owner notification was sent successfully: %r") % result, level=8)
+ signal.alarm(0)
def owner_notification_text(resource, owner, event, success):
organizer = event.get_organizer()