Subject: bug#34763: 27.0.50; url-retrieve-synchronously misbehaves inside eldoc-documentation-function

From: Dmitry Gutov <[email-masked]>
Date: Wed, 10 Apr 2019 04:44:15 +0300

On 09.04.2019 9:34, Eli Zaretskii wrote:

> (I didn't ignore the rest of what you wrote, I just don't have good
> answers for that, and not enough time to study the code and come up
> with such answers.  Sorry.)

That's totally fine, I have my own print-debugging to do anyway.

>> The list gets shorter over time.
> 
> That's why I proposed to kill the processes manually, but you say it
> didn't help, which is strange.  Does killing processes also make the
> list shorter?

It does, yes. If I kill the processes inside Emacs, the connections 
first become "orphaned", but in a few minutes, they disappear, if I 
don't create any new ones. That doesn't fix the problem, unfortunately 
(transfers are still not remotely as fast as they were initially). 
Resetting url-http-open-connections to an empty hash doesn't help either.

I've tried this both at home and at work (different network equipment 
and internet providers, although the routes probably have common 
segments), the behavior is very similar.

Here's a (probably unnecessary) example.

Before:

Proto Recv-Q Send-Q Local Address           Foreign Address 
State       PID/Program name
tcp        0      0 zappa:34964 
ham02s11-in-f36.1e100.net:http ESTABLISHED 31833/src/emacs
tcp        0      0 zappa:43298 
mrs08s04-in-f4.1e100.net:http ESTABLISHED 31833/src/emacs
tcp        0      0 zappa:34954 
ham02s11-in-f36.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:34958 
ham02s11-in-f36.1e100.net:http ESTABLISHED 31833/src/emacs
tcp        0      0 zappa:34940 
ham02s11-in-f36.1e100.net:http ESTABLISHED 31833/src/emacs
tcp        0      0 zappa:34968 
ham02s11-in-f36.1e100.net:http ESTABLISHED 31833/src/emacs
tcp        0      0 zappa:34974 
ham02s11-in-f36.1e100.net:http ESTABLISHED 31833/src/emacs
tcp        0      0 zappa:34960 
ham02s11-in-f36.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:34938 
ham02s11-in-f36.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:34948 
ham02s11-in-f36.1e100.net:http ESTABLISHED 31833/src/emacs
tcp        0      0 zappa:34942 
ham02s11-in-f36.1e100.net:http ESTABLISHED 31833/src/emacs
tcp        0      1 zappa:36306 
ns345059.ip-176-31-225.eu:http LAST_ACK    -
tcp        0      0 zappa:43300 
mrs08s04-in-f4.1e100.net:http ESTABLISHED 31833/src/emacs
tcp        0      0 zappa:34946 
ham02s11-in-f36.1e100.net:http ESTABLISHED 31833/src/emacs
tcp        0      1 zappa:36302 
ns345059.ip-176-31-225.eu:http LAST_ACK    -
tcp        0      0 zappa:34956 
ham02s11-in-f36.1e100.net:http ESTABLISHED 31833/src/emacs
tcp        0      0 zappa:34952 
ham02s11-in-f36.1e100.net:http ESTABLISHED 31833/src/emacs
tcp        0      0 zappa:34944 
ham02s11-in-f36.1e100.net:http ESTABLISHED 31833/src/emacs
tcp        0      1 zappa:36304 
ns345059.ip-176-31-225.eu:http LAST_ACK    -
tcp        0      0 zappa:34950 
ham02s11-in-f36.1e100.net:http ESTABLISHED 31833/src/emacs
tcp        0      0 zappa:34962 
ham02s11-in-f36.1e100.net:http ESTABLISHED 31833/src/emacs
tcp        0      0 zappa:34970 
ham02s11-in-f36.1e100.net:http ESTABLISHED 31833/src/emacs

Right after killing:

Proto Recv-Q Send-Q Local Address           Foreign Address 
State       PID/Program name
tcp        0      0 zappa:34964 
ham02s11-in-f36.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:43298 
mrs08s04-in-f4.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:34954 
ham02s11-in-f36.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:34958 
ham02s11-in-f36.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:34940 
ham02s11-in-f36.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:34976 
ham02s11-in-f36.1e100.net:http ESTABLISHED 31833/src/emacs
tcp        0      0 zappa:34968 
ham02s11-in-f36.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:34974 
ham02s11-in-f36.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:34960 
ham02s11-in-f36.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:34938 
ham02s11-in-f36.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:34948 
ham02s11-in-f36.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:34980 
ham02s11-in-f36.1e100.net:http ESTABLISHED 31833/src/emacs
tcp        0      0 zappa:34942 
ham02s11-in-f36.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:43300 
mrs08s04-in-f4.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:34946 
ham02s11-in-f36.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:34952 
ham02s11-in-f36.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:34944 
ham02s11-in-f36.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:34950 
ham02s11-in-f36.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:34962 
ham02s11-in-f36.1e100.net:http TIME_WAIT   -
tcp        0      0 zappa:34970 
ham02s11-in-f36.1e100.net:http TIME_WAIT   -

It becomes empty if I wait a little.