From 3beac7849a64ba4c3260d54619d517bc735e54c0 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 24 Apr 2003 04:28:33 +0000 Subject: [PATCH] added socket timeout to attempt to prevent stuck processes (sf bug 665487) git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1676 57a73879-2fb5-44c3-a270-3262357dd7e2 --- CHANGES.txt | 1 + roundup/scripts/roundup_admin.py | 6 +++++- roundup/scripts/roundup_mailgw.py | 6 +++++- roundup/scripts/roundup_server.py | 7 ++++++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index d5e1ea7..7b05998 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -97,6 +97,7 @@ Fixed: - can now unset values in CSV editing (sf bug 704788) - fixed rdbms email address lookup (case insensitivity) - email file attachments added to issue files list (sf bug 711501) +- added socket timeout to attempt to prevent stuck processes (sf bug 665487) 2003-02-27 0.5.6 diff --git a/roundup/scripts/roundup_admin.py b/roundup/scripts/roundup_admin.py index be963f5..d4866f8 100644 --- a/roundup/scripts/roundup_admin.py +++ b/roundup/scripts/roundup_admin.py @@ -14,7 +14,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundup_admin.py,v 1.4 2002-09-10 01:07:06 richard Exp $ +# $Id: roundup_admin.py,v 1.5 2003-04-24 04:27:32 richard Exp $ # python version check from roundup import version_check @@ -26,6 +26,10 @@ from roundup.i18n import _ import sys def run(): + # time out after a minute if we can + import socket + if hasattr(socket, 'setdefaulttimeout'): + socket.setdefaulttimeout(60) tool = AdminTool() sys.exit(tool.main()) diff --git a/roundup/scripts/roundup_mailgw.py b/roundup/scripts/roundup_mailgw.py index 891ba7f..65163d8 100644 --- a/roundup/scripts/roundup_mailgw.py +++ b/roundup/scripts/roundup_mailgw.py @@ -14,7 +14,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundup_mailgw.py,v 1.9 2003-03-24 02:56:30 richard Exp $ +# $Id: roundup_mailgw.py,v 1.10 2003-04-24 04:27:32 richard Exp $ # python version check from roundup import version_check @@ -136,6 +136,10 @@ def main(argv): db.close() def run(): + # time out after a minute if we can + import socket + if hasattr(socket, 'setdefaulttimeout'): + socket.setdefaulttimeout(60) sys.exit(main(sys.argv)) # call main diff --git a/roundup/scripts/roundup_server.py b/roundup/scripts/roundup_server.py index 1a113ef..06de678 100644 --- a/roundup/scripts/roundup_server.py +++ b/roundup/scripts/roundup_server.py @@ -16,7 +16,7 @@ # """ HTTP Server that serves roundup. -$Id: roundup_server.py,v 1.21 2003-03-26 04:54:59 richard Exp $ +$Id: roundup_server.py,v 1.22 2003-04-24 04:27:32 richard Exp $ """ # python version check @@ -254,6 +254,11 @@ def abspath(path): def run(): ''' Script entry point - handle args and figure out what to to. ''' + # time out after a minute if we can + import socket + if hasattr(socket, 'setdefaulttimeout'): + socket.setdefaulttimeout(60) + hostname = '' port = 8080 pidfile = None -- 2.30.2