comparison hgext/inotify/linuxserver.py @ 16354:9f98fe05ecf1 stable

inotify: catch SignalInterrupt during shutdown (issue3351) When inotify.repowatcher.shutdown() is called, mercurial.error.SignalInterrupt exception is thrown by mercurial.dispatch._runcatch.catchterm(), therefore socketlistener.shutdown() is not called. Catching this allows cleanup action (removing the socket file) to proceed.
author Thomas Arendsen Hein <thomas@intevation.de>
date Wed, 04 Apr 2012 10:57:48 +0200
parents 64481eee6215
children ae54cff742e2
comparison
equal deleted inserted replaced
16352:4d875bb546dc 16354:9f98fe05ecf1
5 # 5 #
6 # This software may be used and distributed according to the terms of the 6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2 or any later version. 7 # GNU General Public License version 2 or any later version.
8 8
9 from mercurial.i18n import _ 9 from mercurial.i18n import _
10 from mercurial import osutil, util 10 from mercurial import osutil, util, error
11 import server 11 import server
12 import errno, os, select, stat, sys, time 12 import errno, os, select, stat, sys, time
13 13
14 try: 14 try:
15 import linux as inotify 15 import linux as inotify
429 self.socketlistener = socketlistener(ui, root, self.repowatcher, 429 self.socketlistener = socketlistener(ui, root, self.repowatcher,
430 timeout) 430 timeout)
431 431
432 def shutdown(self): 432 def shutdown(self):
433 for obj in pollable.instances.itervalues(): 433 for obj in pollable.instances.itervalues():
434 obj.shutdown() 434 try:
435 obj.shutdown()
436 except error.SignalInterrupt:
437 pass
435 438
436 def run(self): 439 def run(self):
437 self.repowatcher.setup() 440 self.repowatcher.setup()
438 self.ui.note(_('finished setup\n')) 441 self.ui.note(_('finished setup\n'))
439 if os.getenv('TIME_STARTUP'): 442 if os.getenv('TIME_STARTUP'):