467,882 Members | 1,182 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,882 developers. It's quick & easy.

SocketServer shutdown deadlock

All,

With Python 2.5 SocketServer features the shutdown method that can be
called from another thread to stop the serve_forever loop.

However;

When the shutdown method is called before serve_forever, shutdown will
never return.
This can happen when a server is stopped during startup.

In other words, the following program shouldn't hang but it does;

import SocketServer

server = SocketServer.ThreadingTCPServer(("127.0.0.1", 12345),
SocketServer.BaseRequestHandler)
server.shutdown()

What to do?
Nov 6 '08 #1
  • viewed: 3590
Share:
1 Reply
If I wait until _BaseServer__serving is True before calling shutdown
things go better.

Okko Willeboordse wrote:
All,

With Python 2.5 SocketServer features the shutdown method that can be
called from another thread to stop the serve_forever loop.

However;

When the shutdown method is called before serve_forever, shutdown will
never return.
This can happen when a server is stopped during startup.

In other words, the following program shouldn't hang but it does;

import SocketServer

server = SocketServer.ThreadingTCPServer(("127.0.0.1", 12345),
SocketServer.BaseRequestHandler)
server.shutdown()

What to do?
Nov 6 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Olivier Hoarau | last post: by
3 posts views Thread by Ergin Aytac | last post: by
reply views Thread by Adil Hasan | last post: by
5 posts views Thread by missiplicity | last post: by
12 posts views Thread by Paul Rubin | last post: by
reply views Thread by Tomi Hautakoski | last post: by
5 posts views Thread by eliben | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.