Intermittent bug with asyncio and MS Edge

Chris Angelico rosuav at gmail.com
Wed Mar 25 02:24:52 EDT 2020


On Wed, Mar 25, 2020 at 5:14 PM Frank Millman <frank at chagford.com> wrote:
> My guess is that 3.7 is slower to send the files, so Edge starts up all
> 20 connections before it has finished receiving the first one, whereas
> with 3.8, by the time it has opened a few connections the first file has
> been received, so it tries to re-use the same connection to receive the
> next one. By then I have closed the connection. If I am right, it is
> surprising that my program worked *some* of the time.

That is definitely plausible. It would also mean that, depending on
exact browser settings, you might see the same problem crop up in
other situations. Definitely worth the time to investigate this one,
since you now know the ACTUAL reason and can solve the ACTUAL bug.

> It has been an interesting ride, and I have learned a lot. I will now
> look into fixing my program. The easy fix is to just send 'Connection:
> Close', but I will do it properly and implement 'Keep-Alive'.

Yep, and honestly, popping a quick "Connection: Close" isn't a
terrible solution. I have one app where I had a similar weird problem
with keep-alive, and made the opposite decision to you: rather than
sink in the hours to figure out the actual cause, I just slapped in a
"Connection: Close" and moved on. Part of the problem is that my issue
only shows up on HTTPS connections and not on plain HTTP ones, which
makes it extremely fiddly to wireshark (since all the traffic I care
about is encrypted, unless through some miracle the bug is visible
when it has no symptoms). But hey, that's what TODO files are for....

Thank you for including us on your debugging journey. To anyone else
out there with a bizarre problem, I recommend reading over this thread
to get an idea of how to get help - Frank demonstrated a willingness
to sink his own time into this, a comprehensive writeup of all useful
symptoms, and a truly interesting problem report.

ChrisA


More information about the Python-list mailing list