chromium-legacy: Chromium either fails to connect or connects extremely slowly

Describe the bug After installing the new Chromium Legacy build it fails to connect: the connections are slow, the page contents refuse to load, dragging out at the empty view and it takes several relaunch attempts to bring it round. For some reason, Little Snitch Network Monitor shows 2 instances of the _Chromium via Chromium Helper process. On completing installation it asks to allow incoming connections every time. My firewall is off. FWIW, I was forced to create this issue using Firefox 78 ESR.

To Reproduce Steps to reproduce the behavior:

  1. Install or update Chromium
  2. Launch Chromium

Screenshots Screen Shot 2022-09-17 at 04 11 49

Desktop (please complete the following information):

  • OS: macOS X Lion, OS X Mavericks
  • Build 105.0.5195.125 (Official Build) (x86_64)

Logs FWIW, every time this problem arises Console has these messages:

17/09/22 04:04:42,823 Chromium Helper[64877]: SCNetworkReachability server not available
17/09/22 04:04:42,823 Chromium Helper[64877]: SCNetworkReachability server not available
17/09/22 04:04:42,823 Chromium Helper[64877]: Network information server not available
17/09/22 04:04:42,823 Chromium Helper[64877]: com.apple.SystemConfiguration.NetworkInformation: server not available
17/09/22 04:06:47,000 Chromium Helper[65120]: SCNetworkReachability server not available
17/09/22 04:06:47,000 Chromium Helper[65120]: SCNetworkReachability server not available
17/09/22 04:06:47,001 Chromium Helper[65120]: com.apple.SystemConfiguration.NetworkInformation: server not available
17/09/22 04:06:47,001 Chromium Helper[65120]: Network information server not available
17/09/22 04:07:22,922 Chromium Helper[65210]: SCNetworkReachability server not available
17/09/22 04:07:22,922 Chromium Helper[65210]: SCNetworkReachability server not available
17/09/22 04:07:22,922 Chromium Helper[65210]: com.apple.SystemConfiguration.NetworkInformation: server not available

I have no clue if those are relevant.

About this issue

Commits related to this issue

Most upvoted comments

Chrome does explicitly invalidate sockets upon a network interface change. It uses https://source.chromium.org/chromium/chromium/src/+/refs/heads/main:net/base/network_change_notifier_mac.mm;bpv=0 to watch for this.

And it also does seem to invalidate sockets upon sleep. It’s mentioned in https://bugs.chromium.org/p/chromium/issues/detail?id=26156 and https://source.chromium.org/chromium/chromium/src/+/refs/heads/main:base/power_monitor/power_monitor_device_source_mac.mm;l=106-111;bpv=0;bpt=0

But I don’t see Chrome responding to the sleep event…

Hmm I was able to capture a trace:

6873: SOCKET
https://news.ycombinator.com/
Start Time: 2023-06-20 15:32:23.369

t= 6612 [st=    0] +SOCKET_IN_USE  [dt=24802]
                    --> source_dependency = 6893 (HTTP_STREAM_JOB)
t= 6612 [st=    0]    SOCKET_BYTES_SENT
                      --> byte_count = 424
t= 6612 [st=    0]    SSL_SOCKET_BYTES_SENT
                      --> byte_count = 395
t=31414 [st=24802]    SOCKET_READ_ERROR
                      --> net_error = -7 (ERR_TIMED_OUT)
                      --> os_error = 60
t=31414 [st=24802]    SSL_READ_ERROR
                      --> error_lib = 33
                      --> error_reason = 7
                      --> file = "../../net/socket/socket_bio_adapter.cc"
                      --> line = 154
                      --> net_error = -7 (ERR_TIMED_OUT)
                      --> ssl_error = 1
t=31414 [st=24802] -SOCKET_IN_USE
t=31414 [st=24802] -SOCKET_IN_USE
t=31414 [st=24802] -SOCKET_ALIVE
6891: URL_REQUEST
https://news.ycombinator.com/
Start Time: 2023-06-20 15:32:23.366

t= 6609 [st=    0] +REQUEST_ALIVE  [dt=24805]
                    --> priority = "HIGHEST"
                    --> url = "https://news.ycombinator.com/"
t= 6609 [st=    0]   +URL_REQUEST_DELEGATE  [dt=1]
t= 6609 [st=    0]      DELEGATE_INFO  [dt=1]
                        --> delegate_blocked_by = "extension uBlock Origin"
t= 6610 [st=    1]   -URL_REQUEST_DELEGATE
t= 6610 [st=    1]   +URL_REQUEST_START_JOB  [dt=24804]
                      --> load_flags = 18432 (MAIN_FRAME_DEPRECATED | MAYBE_USER_GESTURE)
                      --> method = "GET"
                      --> url = "https://news.ycombinator.com/"
t= 6611 [st=    2]      HTTP_CACHE_GET_BACKEND  [dt=0]
t= 6611 [st=    2]      HTTP_CACHE_OPEN_ENTRY  [dt=0]
t= 6611 [st=    2]      HTTP_CACHE_ADD_TO_ENTRY  [dt=0]
t= 6611 [st=    2]      HTTP_CACHE_READ_INFO  [dt=0]
t= 6611 [st=    2]     +HTTP_STREAM_REQUEST  [dt=1]
t= 6611 [st=    2]        HTTP_STREAM_JOB_CONTROLLER_BOUND
                          --> source_dependency = 6892 (HTTP_STREAM_JOB_CONTROLLER)
t= 6612 [st=    3]        HTTP_STREAM_REQUEST_BOUND_TO_JOB
                          --> source_dependency = 6893 (HTTP_STREAM_JOB)
t= 6612 [st=    3]     -HTTP_STREAM_REQUEST
t= 6612 [st=    3]     +HTTP_TRANSACTION_SEND_REQUEST  [dt=0]
t= 6612 [st=    3]        HTTP_TRANSACTION_SEND_REQUEST_HEADERS
                          --> GET / HTTP/1.1
                              Host: news.ycombinator.com
                              Connection: keep-alive
                              Upgrade-Insecure-Requests: 1
                              Accept-Encoding: gzip, deflate, br
                              Accept-Language: en-US,en;q=0.9
t= 6612 [st=    3]     -HTTP_TRANSACTION_SEND_REQUEST
t= 6612 [st=    3]     +HTTP_TRANSACTION_READ_HEADERS  [dt=24802]
t= 6612 [st=    3]        HTTP_STREAM_PARSER_READ_HEADERS  [dt=24802]
                          --> net_error = -7 (ERR_TIMED_OUT)
t=31414 [st=24805]     -HTTP_TRANSACTION_READ_HEADERS
                        --> net_error = -7 (ERR_TIMED_OUT)
t=31414 [st=24805]   -URL_REQUEST_START_JOB
                      --> net_error = -7 (ERR_TIMED_OUT)
t=31414 [st=24805]    URL_REQUEST_DELEGATE  [dt=0]
t=31414 [st=24805] -REQUEST_ALIVE
                    --> net_error = -7 (ERR_TIMED_OUT)
6892: HTTP_STREAM_JOB_CONTROLLER
https://news.ycombinator.com/
Start Time: 2023-06-20 15:32:23.368

t=6611 [st=0] +HTTP_STREAM_JOB_CONTROLLER  [dt=1]
               --> is_preconnect = false
               --> url = "https://news.ycombinator.com/"
t=6611 [st=0]    HTTP_STREAM_JOB_CONTROLLER_BOUND
                 --> source_dependency = 6891 (URL_REQUEST)
t=6611 [st=0]   +PROXY_RESOLUTION_SERVICE  [dt=0]
t=6611 [st=0]      PROXY_RESOLUTION_SERVICE_RESOLVED_PROXY_LIST
                   --> pac_string = "DIRECT"
t=6611 [st=0]   -PROXY_RESOLUTION_SERVICE
t=6611 [st=0]    HTTP_STREAM_JOB_CONTROLLER_PROXY_SERVER_RESOLVED
                 --> proxy_server = "DIRECT"
t=6611 [st=0]    HTTP_STREAM_REQUEST_STARTED_JOB
                 --> source_dependency = 6893 (HTTP_STREAM_JOB)
t=6612 [st=1] -HTTP_STREAM_JOB_CONTROLLER
6893: HTTP_STREAM_JOB
https://news.ycombinator.com/
Start Time: 2023-06-20 15:32:23.368

t=6611 [st=0] +HTTP_STREAM_JOB  [dt=1]
               --> expect_spdy = "false"
               --> original_url = "https://news.ycombinator.com/"
               --> priority = "HIGHEST"
               --> source_dependency = 6892 (HTTP_STREAM_JOB_CONTROLLER)
               --> url = "https://news.ycombinator.com/"
               --> using_quic = "false"
t=6611 [st=0]    HTTP_STREAM_JOB_WAITING  [dt=0]
                 --> should_wait = false
t=6612 [st=1]   +HTTP_STREAM_JOB_INIT_CONNECTION  [dt=0]
t=6612 [st=1]     +HOST_RESOLVER_IMPL_REQUEST  [dt=0]
                   --> address_family = 0
                   --> allow_cached_response = true
                   --> host = "news.ycombinator.com:443"
                   --> is_speculative = false
t=6612 [st=1]        HOST_RESOLVER_IMPL_IPV6_REACHABILITY_CHECK
                     --> cached = true
                     --> ipv6_available = true
t=6612 [st=1]     -HOST_RESOLVER_IMPL_REQUEST
                   --> net_error = -804 (ERR_DNS_CACHE_MISS)
t=6612 [st=1]     +SOCKET_POOL  [dt=0]
t=6612 [st=1]        SOCKET_POOL_REUSED_AN_EXISTING_SOCKET
                     --> idle_ms = 73125
t=6612 [st=1]        SOCKET_POOL_BOUND_TO_SOCKET
                     --> source_dependency = 6873 (SOCKET)
t=6612 [st=1]     -SOCKET_POOL
t=6612 [st=1]   -HTTP_STREAM_JOB_INIT_CONNECTION
t=6612 [st=1]    HTTP_STREAM_REQUEST_PROTO
                 --> proto = "http/1.1"
t=6612 [st=1]    HTTP_STREAM_JOB_BOUND_TO_REQUEST
                 --> source_dependency = 6891 (URL_REQUEST)
t=6612 [st=1] -HTTP_STREAM_JOB

I think this is related to https://bugs.chromium.org/p/chromium/issues/detail?id=447463 https://bugs.chromium.org/p/chromium/issues/detail?id=111474 https://bugs.chromium.org/p/chromium/issues/detail?id=27400 and https://bugs.chromium.org/p/chromium/issues/detail?id=16367. It’s seems what’s happening is the following:

  • Chromium keeps a pool of active tcp sockets for a given domain around, which it reuses when possible to avoid a new tcp handshake
  • (Of course this requires http 1.1 keep alive, since otherwise the server would close the tcp connection immediately)
  • Chromium seems to keep the sockets alive for 5 minutes at most. Normally this timeout won’t actually be hit, because the server’s http keepalive would probably expire before then and close the TCP connection.
  • However, if the laptop goes to sleep before then, it never actually receives the TCP close, so the client still thinks the connection is active.
  • In normal circumstances if you send a request on a socket that the server has already closed, it should respond with a tcp reset.
  • However it seems for some reason somewhere in my network setup (don’t even know if it’s on my end or if it’s on server’s end), sending content on an “expired” tcp connection is just getting silently dropped, instead of the reset that should be sent when the server doesn’t recognize the tcp 4-tuple.

I should be able to replicate this manually using telnet, let me try that.