[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2021-05-27 Thread Irit Katriel
Irit Katriel added the comment: This was added to the documentation under issue39797. -- nosy: +iritkatriel resolution: -> out of date stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2016-02-10 Thread Martin Panter
Martin Panter added the comment: Michael’s patch looks like it adds some backwards compatibility problems. The forking server overwrites a signal handler, and shutdown() no longer seems to wait at all. It seems that people want shutdown() to do different things. Mark doesn’t want it to wait

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2013-04-07 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- nosy: +tshepang ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12463 ___ ___

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-12-26 Thread Michael P. Reilly
Michael P. Reilly arc...@gmail.com added the comment: Here is a patch to socketserver.py which can be applied to 2.6, 2.7 and 3.2. The fix is for BaseServer, ForkingMixIn and ThreadingMixIn. All three now correctly respond to the shutdown method. I have no way of testing Windows or MacOSX

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-12-26 Thread Michael P. Reilly
Michael P. Reilly arc...@gmail.com added the comment: An update test program. Execute with appropriate PYTHONPATH (to dir to patched module and explicit interpreter executable: PYTHONPATH=$PWD/2.7/b/Lib python2.7 $PWD/simpletest.py -- Added file:

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-12-22 Thread Michael P. Reilly
Michael P. Reilly arc...@gmail.com added the comment: I'm seeing that shutdown does have a race condition just using BaseHTTPServer.HTTPServer. See the attached simple script. Then access http://localhost:8081. This is using both Python 2.6.6 (r266:84292, May 22 2011, 16:47:42) on Oracle

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-08-08 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Why do you say it hangs? It doesn't hang, it just waits for you to call serve_forever(): it's not a bug, it's actually a feature. Okay, for my case, How I should correctly terminate thread? Conditions: 1. signal may appear at any time 2.

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-26 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: In my case, exception occured in separate thread between the begginig of the thread and starting loop. Main thread has a code that correctly stops that separate thread. It just calls loop_thread.server.server_close() and after that, calls

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-26 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: In my case, exception occured in separate thread between the begginig of the thread and starting loop. Main thread has a code that correctly stops that separate thread. It just calls loop_thread.server.server_close() and after that, calls

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-26 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Why you create variable mirror? -- self.__running = False self.__is_shut_down.set() -- You other code is racy. exception may occur at any time. Why not to test state of __is_shut_down

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-26 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: class ThreadedRPC(Thread, SimpleXMLRPCServer): def __init__(self): Thread.__init__(self) SimpleXMLRPCServer.__init__(self) # python bug workaround, which eliminate hang on test_exception

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-26 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: [...] # note, thread may die in any time! regardles of isAlive() # if thread dead before calling serve_forever(), will hang here without a workaround rpc.shutdown() # from xmlrpcservr. Why do you say it hangs? It doesn't hang,

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-26 Thread Charles-François Natali
Charles-François Natali neolo...@free.fr added the comment: When you join a thread which hasn't been started, you get an exception, not a deadlock. When you join a newly-created queue, it doesn't wait until an item is submitted to the queue. But honestly I don't really care, since it's such a

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-26 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: When you join a thread which hasn't been started, you get an exception, not a deadlock. But we don't have a deadlock here: another thread could perfectly well call serve_forever() in the meantime and shutdown() should then return after having

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-25 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Attached a patch with a test and the proposed fix. -- keywords: +needs review, patch stage: - patch review versions: -Python 2.6, Python 3.1, Python 3.4 Added file: http://bugs.python.org/file22749/issue12463.patch

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-25 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Yes, this is what I want. Thanks. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12463 ___

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-25 Thread Charles-François Natali
Charles-François Natali neolo...@free.fr added the comment: Seems reasonable to me. What bothers me is this comment in shutdown's docstring: Stops the serve_forever loop. Blocks until the loop has finished. This must be called while serve_forever() is running in another

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-25 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: OK, so this is intentional. But why? Why does it *have to* block on every call? It would be more reasonable to make in not block if serve_forever() is not running and for example add a function to check whether serve_forever() is running or

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-25 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: IMHO, both methods should raise an exception (RuntimeError maybe) in case the server is already started or stopped, at least in Python 3.3, while previous python versions should silently pass. It also makes sense to add a running

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-25 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: Patch in attachment (tests still missing). -- Added file: http://bugs.python.org/file22755/socketserver.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12463

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-25 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: New patch including tests. -- Added file: http://bugs.python.org/file22762/socketserver.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12463

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-25 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Can you explain the issue a bit more? If thread A calls shutdown(), and thread B calls serve_forever() a bit later, thread A should IMO wait for serve_forever() to finish. -- nosy: +pitrou ___ Python

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-03 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- nosy: +petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12463 ___ ___ Python-bugs-list

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-01 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: Why not to call self.__is_shut_down.set() in constructor ? In reality, if event loop was not started, it mean that server is shut down. -- components: Library (Lib) messages: 139565 nosy: mmarkk priority: normal severity: normal

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-01 Thread Santoso Wijaya
Changes by Santoso Wijaya santoso.wij...@gmail.com: -- nosy: +santa4nt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12463 ___ ___