SocketServer shutdown deadlock

  • Thread starter Okko Willeboordse
  • Start date
O

Okko Willeboordse

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?
 
O

Okko Willeboordse

If I wait until _BaseServer__serving is True before calling shutdown
things go better.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top