Reland "HttpStreamPool: Group TCP attempts in slots" This is a reland of commit b6b720b7be6b6951c37bb2cc38c231dc9b35539f. The original CL was reverted because it caused CHECK() failures. Diff from the original CL are: * Don't use `NonSlowTcpBasedAttemptCount()` to calculate active stream counts. It didn't make sense. * Add `CanStartFallbackTcpBasedAttempt()`, which returns true if there is a slow attempt for one address family (e.g. IPv4) and no corresponding attempt for the other address family (e.g. IPv6) has been started yet. * Change a CHECK() with DumpWithoutCrashing() in `CreateTextBasedStreamAndNotify()` to investigate potential bugs. * Add a test to ensure the previous crash doesn't happen. Original change's description: > Revert "HttpStreamPool: Group TCP attempts in slots" > > This reverts commit ef6ba930ba83b74518f3ed7d89247c4c82e84764. > > Reason for revert: > The Suspect CL https://chromium-review.googlesource.com/q/Iba4feb76ecbb3779cbfc80ffd0d3d311b24328ad is highly likely the cause of the crash. Please see the crash report http://crash/58cb8b91483394cf. > Rebase the Revert CL on top of main branch with conflicts allowed option to prevent false positive merge conflicts. > > If you agree with the revert CL, please approve it and mark as Commit-Queue +2 to submit it. > > More details can be found in the go/crash-revert-cls-creation. > > Original change's description: > > HttpStreamPool: Group TCP attempts in slots > > > > This CL introduces the concept of a TcpBasedAttemptSlot in the > > HttpStreamPool. The purpose of this slot is to group a single IPv4 and a > > single IPv6 connection attempt together. This allows the pool to treat > > them as a single unit for the purpose of connection limits. > > > > This change is motivated by performance issues on dual-stack networks > > where one address family (e.g., IPv6) might be slow or unresponsive. In > > such scenarios, the slow attempt could occupy a connection slot for an > > extended period, preventing other, potentially faster, attempts from > > being made. > > > > By grouping the attempts, the HttpStreamPool can more intelligently > > manage its resources and avoid getting stalled by a single slow address > > family. > > > > This behavior is similar to the non-HEv3 code path, where > > TransportConnectJob could have both IPv4 and IPv6 SubJobs at the same > > time. > > > > Another approach considered is to count attempts per address family. WIP > > CL is [1]. Downsides of the approach are: > > * AttemptManager::CanAttemptConnection() can be called without addresses > > so we can't count per address family. > > * There is no single concept of the group being "full". The CL uses > > NonSlowTcpBasedAttemptCount() to proxy it, but it breaks some > > assumptions the rest of the code has. For example, The CL is failing > > on a test because AttemptManager creates a HttpBasicStream exceeding > > the group's limit. To avoid this, we need to cancel attempts in the > > other address family when an attempt succeeds. > > * The WIP CL always increment the pool's total connecting count when > > creating an attempt. This means that a group could have up to 12 > > connecting attempts. This could make Chrome to reach the pool's limit > > (256) more often than the non-HEv3 code path. > > > > [1] https://crrev.com/c/6852978 > > > > Change-Id: Iba4feb76ecbb3779cbfc80ffd0d3d311b24328ad > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6968320 > > Reviewed-by: Adam Rice <ricea@chromium.org> > > Commit-Queue: Kenichi Ishibashi <bashi@chromium.org> > > Cr-Commit-Position: refs/heads/main@{#1521020} > > > > Change-Id: I3d526deb06da385185c839896d127aee91d4d1b4 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6991510 > Reviewed-by: Kenichi Ishibashi <bashi@chromium.org> > Reviewed-by: mmenke <mmenke@chromium.org> > Commit-Queue: Kenichi Ishibashi <bashi@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1521716} Bug: 383606724 Change-Id: Iaeff5aeada5f7ae0ed5b980335903de01eb693f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7006044 Reviewed-by: Adam Rice <ricea@chromium.org> Commit-Queue: Kenichi Ishibashi <bashi@chromium.org> Cr-Commit-Position: refs/heads/main@{#1524106}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.