Intermittent bug with asyncio and MS Edge

Kouli dev at kou.li
Sun Mar 22 07:30:44 EDT 2020


The RST from Python is probably caused here by HTTP 1.1 server closing TCP
connection without signalling "Connection: Close" in response headers: a
fast HTTP client will send another HTTP request before its TCP stack
detects the connection is being closed - and packets containing this new
requests will be replied with RST.

When you delay your response (as you mentioned), the Edge browser probably
opens more HTTP connections and will not send more HTTP requests in a
single connection as described above.

You should search for the cause Python closes the TCP connection (instead
of waiting for another HTTP request).

Kouli

On Sun, Mar 22, 2020 at 12:04 PM Chris Angelico <rosuav at gmail.com> wrote:

> On Sun, Mar 22, 2020 at 12:45 AM Frank Millman <frank at chagford.com> wrote:
> >
> > Hi all
> >
> > I have a strange intermittent bug.
> >
> > The role-players -
> >      asyncio on Python 3.8 running on Windows 10
> >      Microsoft Edge running as a browser on the same machine
> >
> > The bug does not occur with Python 3.7.
> > It does not occur with Chrome or Firefox.
> > It does not occur when MS Edge connects to another host on the network,
> > running the same Python program (Python 3.8 on Fedora 31).
>
> What exact version of Python 3.7 did you test? I'm looking through the
> changes to asyncio and came across this one, which may have some
> impact.
>
> https://bugs.python.org/issue36801
>
> Also this one made a change that introduced a regression that was
> subsequently fixed. Could be interesting.
>
> https://bugs.python.org/issue36802
>
> What happens if you try awaiting your writes? I think it probably
> won't make any difference, though - from my reading of the source, I
> believe that "await writer.write(...)" is the same as
> "writer.write(...); await writer.drain()", so it's going to be exactly
> the same as you're already doing.
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>


More information about the Python-list mailing list