Skip to content

Commit 24cb13e

Browse files
author
Richard Jones
committed
added socket timeout to attempt to prevent stuck processes [SF#665487]
1 parent a5a9f66 commit 24cb13e

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ Fixed:
9797
- can now unset values in CSV editing (sf bug 704788)
9898
- fixed rdbms email address lookup (case insensitivity)
9999
- email file attachments added to issue files list (sf bug 711501)
100+
- added socket timeout to attempt to prevent stuck processes (sf bug 665487)
100101

101102

102103
2003-02-27 0.5.6

roundup/scripts/roundup_admin.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1515
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1616
#
17-
# $Id: roundup_admin.py,v 1.4 2002-09-10 01:07:06 richard Exp $
17+
# $Id: roundup_admin.py,v 1.5 2003-04-24 04:27:32 richard Exp $
1818

1919
# python version check
2020
from roundup import version_check
@@ -26,6 +26,10 @@
2626
import sys
2727

2828
def run():
29+
# time out after a minute if we can
30+
import socket
31+
if hasattr(socket, 'setdefaulttimeout'):
32+
socket.setdefaulttimeout(60)
2933
tool = AdminTool()
3034
sys.exit(tool.main())
3135

roundup/scripts/roundup_mailgw.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1515
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1616
#
17-
# $Id: roundup_mailgw.py,v 1.9 2003-03-24 02:56:30 richard Exp $
17+
# $Id: roundup_mailgw.py,v 1.10 2003-04-24 04:27:32 richard Exp $
1818

1919
# python version check
2020
from roundup import version_check
@@ -136,6 +136,10 @@ def main(argv):
136136
db.close()
137137

138138
def run():
139+
# time out after a minute if we can
140+
import socket
141+
if hasattr(socket, 'setdefaulttimeout'):
142+
socket.setdefaulttimeout(60)
139143
sys.exit(main(sys.argv))
140144

141145
# call main

roundup/scripts/roundup_server.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717
""" HTTP Server that serves roundup.
1818
19-
$Id: roundup_server.py,v 1.21 2003-03-26 04:54:59 richard Exp $
19+
$Id: roundup_server.py,v 1.22 2003-04-24 04:27:32 richard Exp $
2020
"""
2121

2222
# python version check
@@ -254,6 +254,11 @@ def abspath(path):
254254
def run():
255255
''' Script entry point - handle args and figure out what to to.
256256
'''
257+
# time out after a minute if we can
258+
import socket
259+
if hasattr(socket, 'setdefaulttimeout'):
260+
socket.setdefaulttimeout(60)
261+
257262
hostname = ''
258263
port = 8080
259264
pidfile = None

0 commit comments

Comments
 (0)