Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
ZODB
Commits
f152c463
Commit
f152c463
authored
Oct 07, 2003
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use kill, when possible, to shutdown a stale test server.
parent
220b5ca0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
src/ZEO/tests/zeoserver.py
src/ZEO/tests/zeoserver.py
+18
-5
No files found.
src/ZEO/tests/zeoserver.py
View file @
f152c463
...
@@ -20,6 +20,7 @@ import errno
...
@@ -20,6 +20,7 @@ import errno
import
getopt
import
getopt
import
random
import
random
import
socket
import
socket
import
signal
import
asyncore
import
asyncore
import
threading
import
threading
import
ThreadedAsync.LoopCallback
import
ThreadedAsync.LoopCallback
...
@@ -127,14 +128,26 @@ class Suicide(threading.Thread):
...
@@ -127,14 +128,26 @@ class Suicide(threading.Thread):
# chance that the server gives up before the clients.
# chance that the server gives up before the clients.
time
.
sleep
(
330
)
time
.
sleep
(
330
)
log
(
"zeoserver"
,
"suicide thread invoking shutdown"
)
log
(
"zeoserver"
,
"suicide thread invoking shutdown"
)
from
ZEO.tests.forker
import
shutdown_zeo_server
# XXX If the -k option was given to zeoserver, then the process will
# If the server hasn't shut down yet, the client may not be
# go away but the temp files won't get cleaned up.
# able to connect to it. If so, try to kill the process to
shutdown_zeo_server
(
self
.
_adminaddr
)
# force it to shutdown.
if
hasattr
(
os
,
"kill"
):
os
.
kill
(
pid
,
signal
.
SIGTERM
)
time
.
sleep
(
5
)
os
.
kill
(
pid
,
signal
.
SIGKILL
)
else
:
from
ZEO.tests.forker
import
shutdown_zeo_server
# XXX If the -k option was given to zeoserver, then the
# process will go away but the temp files won't get
# cleaned up.
shutdown_zeo_server
(
self
.
_adminaddr
)
def
main
():
def
main
():
label
=
'zeoserver:%d'
%
os
.
getpid
()
global
pid
pid
=
os
.
getpid
()
label
=
'zeoserver:%d'
%
pid
log
(
label
,
'starting'
)
log
(
label
,
'starting'
)
# We don't do much sanity checking of the arguments, since if we get it
# We don't do much sanity checking of the arguments, since if we get it
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment