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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
a1acbcd0
Commit
a1acbcd0
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
f5691d3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
trunk/src/ZEO/tests/zeoserver.py
trunk/src/ZEO/tests/zeoserver.py
+18
-5
No files found.
trunk/src/ZEO/tests/zeoserver.py
View file @
a1acbcd0
...
...
@@ -20,6 +20,7 @@ import errno
import
getopt
import
random
import
socket
import
signal
import
asyncore
import
threading
import
ThreadedAsync.LoopCallback
...
...
@@ -127,14 +128,26 @@ class Suicide(threading.Thread):
# chance that the server gives up before the clients.
time
.
sleep
(
330
)
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
# go away but the temp files won't get cleaned up.
shutdown_zeo_server
(
self
.
_adminaddr
)
# If the server hasn't shut down yet, the client may not be
# able to connect to it. If so, try to kill the process to
# 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
():
label
=
'zeoserver:%d'
%
os
.
getpid
()
global
pid
pid
=
os
.
getpid
()
label
=
'zeoserver:%d'
%
pid
log
(
label
,
'starting'
)
# 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