ArielGlenn has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/306207

Change subject: scheduler: make pylint not whine about unused args to signal 
handler
......................................................................

scheduler: make pylint not whine about unused args to signal handler

also fix up the close of open file descriptors in the
signal handler

Change-Id: I41721f3565d9e9b1ef047236caccd27d9a57cd8e
---
M xmldumps-backup/dumpscheduler.py
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dumps 
refs/changes/07/306207/1

diff --git a/xmldumps-backup/dumpscheduler.py b/xmldumps-backup/dumpscheduler.py
index ea4969a..e929eee 100644
--- a/xmldumps-backup/dumpscheduler.py
+++ b/xmldumps-backup/dumpscheduler.py
@@ -228,7 +228,7 @@
         self.cacher = Cacher(cache, self.my_id, restore, rerun)
         self.mailer = Mailer(mailhost, email_from)
 
-    def handle_hup(self, signo_unused, frame_unused):
+    def handle_hup(self, signo, dummy_frame):
         """
         ignore any more hups
         shoot all children
@@ -236,6 +236,7 @@
         re-exec ourselves
         """
         signal.signal(signal.SIGHUP, signal.SIG_IGN)
+        LOG.info('handling hup, signal %s received', signo)
 
         for command in self.commands:
             if 'processids' in command:
@@ -251,8 +252,8 @@
         for filedesc in reversed(range(os.sysconf('SC_OPEN_MAX'))):
             if filedesc not in [sys.__stdin__, sys.__stdout__, sys.__stderr__]:
                 try:
-                    filedesc.close()
-                except IOError:
+                    os.close(filedesc)
+                except (IOError, OSError):
                     pass
         os.execv(sys.executable, [sys.executable] + sys.argv)
 

-- 
To view, visit https://gerrit.wikimedia.org/r/306207
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41721f3565d9e9b1ef047236caccd27d9a57cd8e
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps
Gerrit-Branch: master
Gerrit-Owner: ArielGlenn <ar...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to