[issue2302] Uses of SocketServer.BaseServer.shutdown have a race

2010-04-25 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Fixed with a test in r80484 (trunk), r80486 (2.6), r80487 (py3k), r80491 (3.1).

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2302] Uses of SocketServer.BaseServer.shutdown have a race

2010-04-19 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

By the way, getting rid of poll_interval for a file descriptor is easy under 
Unix, but wouldn't work under Windows (where select() only takes sockets, not 
arbitrary file descriptors).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2302] Uses of SocketServer.BaseServer.shutdown have a race

2010-04-17 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a simpler patch. It also fixes the wrong use of a lock instead of an 
event in test_httpservers. With this patch, test_httpservers runs forever 
without freezing.

--
Added file: http://bugs.python.org/file16964/shutdown.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2302] Uses of SocketServer.BaseServer.shutdown have a race

2010-04-17 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

After a bit of investigation, this issue seems to be exactly why 
test_httpservers sometimes hangs.
The patch looks complicated to me, though; I don't think we really have to 
support the multiple shutdowns case.

--
nosy: +pitrou
priority:  -> normal
versions: +Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2302] Uses of SocketServer.BaseServer.shutdown have a race

2008-06-03 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' <[EMAIL PROTECTED]>:


--
nosy: +giampaolo.rodola

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2302] Uses of SocketServer.BaseServer.shutdown have a race

2008-05-07 Thread Rafael Zanella

Rafael Zanella <[EMAIL PROTECTED]> added the comment:

>With the code as it stands, calls to shutdown that happen before
>serve_forever enters its loop will deadlock, and there's no simple way
>for the user to avoid this. The attached patch prevents the deadlock and
>allows multiple serve_forever..shutdown cycles, but it's pretty
>complicated. I could make it a lot simpler by making shutdown permanent:
>any later serve_forever calls would return immediately.

Never thought of using the SocketServer taht way, wouldn't the person
doing this bunch of shutdown()s and serve_forever()s be better off using
handle_request() on a loop instead ?

>A third choice would be to add a .serve_in_thread function that returns
>a token that can be used to shut down exactly that loop, instead of
>putting .shutdown() on the server. Any opinions?

I don't think I understand this part, what loop do you refer to ?

--
nosy: +zanella

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2302] Uses of SocketServer.BaseServer.shutdown have a race

2008-03-16 Thread Jeffrey Yasskin

Changes by Jeffrey Yasskin <[EMAIL PROTECTED]>:


--
assignee:  -> jyasskin

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2302] Uses of SocketServer.BaseServer.shutdown have a race

2008-03-16 Thread Jeffrey Yasskin

New submission from Jeffrey Yasskin <[EMAIL PROTECTED]>:

With the code as it stands, calls to shutdown that happen before
serve_forever enters its loop will deadlock, and there's no simple way
for the user to avoid this. The attached patch prevents the deadlock and
allows multiple serve_forever..shutdown cycles, but it's pretty
complicated. I could make it a lot simpler by making shutdown permanent:
any later serve_forever calls would return immediately.

A third choice would be to add a .serve_in_thread function that returns
a token that can be used to shut down exactly that loop, instead of
putting .shutdown() on the server. Any opinions?

--
components: Library (Lib)
files: race_free_shutdown.patch
keywords: patch, patch
messages: 63579
nosy: jyasskin
severity: normal
status: open
title: Uses of SocketServer.BaseServer.shutdown have a race
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file9681/race_free_shutdown.patch

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com