[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-10-06 Thread Yury Selivanov

Yury Selivanov added the comment:

Alright, I've backported the fix to 3.4. Closing this.

--
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-09-26 Thread Yury Selivanov

Yury Selivanov added the comment:

> Jim ask for a backport.

Sorry Jim, was replying from my email client, didn't see all messages.

> This is arguably a security issue because it's a DoS vector.

Yeah, I can see why.  I can commit this to 3.4 in a week.  Christian, feel free 
to commit this if you want this issue to be closed earlier.

--

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-09-26 Thread Jim Fulton

Jim Fulton added the comment:

This is arguably a security issue because it's a DoS vector.

I don't feel strongly about it though.

--

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-09-26 Thread Christian Heimes

Christian Heimes added the comment:

Jim ask for a backport. In case the problem is not a security issue that needs 
to be backported, feel free to close the ticket.

--

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-09-26 Thread Yury Selivanov

Yury Selivanov added the comment:

Isn't 3.4 in security fixes only mode?

--
status: pending -> open

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-09-26 Thread Christian Heimes

Christian Heimes added the comment:

Yuri, are you going to backport the fix to 3.4?

--
assignee:  -> yselivanov
nosy: +christian.heimes
status: open -> pending
versions:  -Python 3.5

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-09-17 Thread Jim Fulton

Jim Fulton added the comment:

Yes, that change addresses this issue. Thanks!

Will this be backported?

--
resolution:  -> fixed

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-09-16 Thread Jim Fulton

Jim Fulton added the comment:

Cool, I will verify soon.

--

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-09-15 Thread Yury Selivanov

Yury Selivanov added the comment:

It looks like this was fixed by #27759!.  Jim, could you please verify?

--

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-07-06 Thread Jim Fulton

Changes by Jim Fulton :


--
type: behavior -> security

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-29 Thread Yury Selivanov

Yury Selivanov added the comment:

> It also doesn't occur with uvloop, which I assume still uses sockets.

No, uvloop doesn't use python sockets or select for IO at all.  All IO is done 
in libuv.

> WRT CPython/sockets this problem doesn't happen if I use asyncore to accept 
> connections and hand them off to create_connection. :)

Interesting.

--

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

WRT CPython/sockets this problem doesn't happen if I use asyncore to accept 
connections and hand them off to create_connection. :)

It also doesn't occur with uvloop, which I assume still uses sockets.

Also, FWIW, the relevant ZEO test passes if I use SSL, which is how I'm working 
around this now for the tests.

--

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-29 Thread Guido van Rossum

Guido van Rossum added the comment:

No, I just don't have a computer right now, only a phone.

--Guido (mobile)

--

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-29 Thread Yury Selivanov

Yury Selivanov added the comment:

Running out of time to debug this today.  I think this is a bug in CPython, in 
either socket or select module.  When I inject some debug code in selectors.py 
and replace KQueue with select(), I can see that the server thread's selector 
stops working at some point due to a EBADF error.

I think something similar is happening with the KQueue selector -- at some 
point it just stops to return events correctly.

Again, I might be wrong about this all, but this is what I think after 2.5 
hours of debugging.

--

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

Yuri, right you are. Thanks.

Марк, see https://bugs.launchpad.net/zodb/+bug/135108/comments/9

--

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-29 Thread Yury Selivanov

Yury Selivanov added the comment:

Jim, I think you wanted to post this link in this issue: 
https://bugs.launchpad.net/zodb/+bug/135108/comments/9 instead of in #27392.

I can reproduce this on my mac, but so far I've no idea what's going on.

--

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

Here's a version sans prints

--
Added file: http://bugs.python.org/file43581/echo-no-print.py

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-29 Thread Марк Коренберг

Марк Коренберг added the comment:

One more thing. Why you set socket.SO_LINGER ? and why lingering timeout is 0 
seconds ?

Removing that eliminate problem completely.

--

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-29 Thread Jim Fulton

Changes by Jim Fulton :


Removed file: http://bugs.python.org/file43540/echo.py

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-29 Thread Марк Коренберг

Марк Коренберг added the comment:

Also I recommend you to use asyncio streams, instead of reinventing wheels.

So, reading your command will look like:

data = await stream.read_exactly(4)
(len,) = unpack(">I", data)
command = await stream.read_exactly(len)

--

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-29 Thread Марк Коренберг

Марк Коренберг added the comment:

Plese reduce even more. I mean remove debugging, specifi commands, and all 
extra code, that is not related to original problem.

--

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

This is already pretty minimal. There are no external dependencies.

--

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-26 Thread Guido van Rossum

Guido van Rossum added the comment:

Yeah, I'd like to see a more minimal repro to understand what's going in.

--

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-26 Thread Марк Коренберг

Марк Коренберг added the comment:

Please reduce program, and make sure it still hangs.

--
nosy: +mmarkk

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-25 Thread Jim Fulton

New submission from Jim Fulton:

I recently ported ZEO to asyncio.

We'd had a bug in our old asyncore-based server where the server would hang if 
several connections were made and then immediately disconnected on Mac OS X.  
This was due to an error-handling bug in our code that we fixed.  We have a 
regression test for this case.

The regression test for this case fails using asyncio.Server.

I've attached a (ZEO-independent) script that demonstrates the problem.

If you run the script with Python 3.4 or 3.5, I expect the script will hang. It 
does for me on Mac OS X 10.10.5 and Ubuntu 14.04.

--
components: asyncio
files: echo.py
messages: 269256
nosy: gvanrossum, haypo, j1m, yselivanov
priority: normal
severity: normal
status: open
title: Asyncio server hang when clients connect and immediately disconnect
type: behavior
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file43540/echo.py

___
Python tracker 

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