extract migration code [chromium/src : main]

0 views
Skip to first unread message

Ryan Hamilton (Gerrit)

unread,
Nov 7, 2024, 11:17:35 AM11/7/24
to Dan Zhang, Ryan Hamilton, Tricium, chromium...@chromium.org, Dan Zhang, net-r...@chromium.org
Attention needed from Dan Zhang

Ryan Hamilton added 11 comments

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Ryan Hamilton . resolved

A few first-pass comments. There is a LOT of new code here which I think we need to figure out how to test and how to break into somewhat smaller pieces.

File net/quic/platform/impl/quic_chromium_net_log.h
Line 13, Patchset 2 (Latest):class NET_EXPORT_PRIVATE QuicChromiumNetLog : public quic::QuicEventLog {
Ryan Hamilton . unresolved

I definitely don't think we should make a Chrome net log platform API. Instead, I think we should add various `OnFooHappened()` debug visitor methods which pass up the relevant information that Chrome-specific code can add to net-log.

File net/quic/quic_network_change_observer.h
Line 258, Patchset 2 (Latest): const bool migrate_session_on_network_change_;
Ryan Hamilton . unresolved

It looks like a number of these fields are also in QuicNetworkChangeParameters. How 'bout we just store this struct in a member instead of duplicating?

Line 89, Patchset 2 (Latest):class QUICHE_EXPORT QuicNetworkChangeObserver {
Ryan Hamilton . unresolved

As discussed yesterday this seems like a "MigrationManager" more than a "NetworkChangeObserver"

Line 72, Patchset 2 (Latest): bool migrate_session_early;
Ryan Hamilton . unresolved

nit: brief comments for each of these. For example, what does "Early" mean here?

Line 66, Patchset 2 (Latest):struct QuicNetworkChangeParameters {
Ryan Hamilton . unresolved

nit: If I understand this correctly, this is a collection of configuration variables for migration behavior. Is that right? If so maybe "QuicConnectionMigrationConfiguration" or some such.

File net/quic/quic_network_change_observer.cc
Line 3, Patchset 2 (Latest):// found in the LICENSE file.
Ryan Hamilton . unresolved

There is a LOT of new code here, and no unit tests. I think we should figure out how to write tests for this.

Line 242, Patchset 2 (Latest): net_log_->AddEventWithInt64Params(
Ryan Hamilton . unresolved

Just reiterating my earlier point, instead of having a NetLog platform API for this, let's instead have a DebugVisitor (or something) for this class. Here we could call something like `debug_visitor_.OnNetworkConnected(QuicNetworkHandle network)`. Then the Chromium implementation can send this to the NetLog. This is how net/quic/quic_connection_logger.h works today.

Line 493, Patchset 2 (Latest): if (!static_cast<net::QuicChromiumClientSession&>(session_.get())
Ryan Hamilton . unresolved

Since we're targeting this code to live in QUICHE, I don't think we can directly reference Chromium classes?

File net/quic/quic_path_context_manager.h
Line 58, Patchset 2 (Latest): virtual void CreatePathValidationContext(
Ryan Hamilton . unresolved

Comment for this method. It sorta seems like it's a factory method but I don't think I understand what it's expected to do.

Line 29, Patchset 2 (Latest):class QUICHE_EXPORT QuicPathContextManager {
Ryan Hamilton . unresolved

Class comment, please. I'm not clear how this is intended to be used.

Open in Gerrit

Related details

Attention is currently required from:
  • Dan Zhang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I59f663699a63754a7cf04bd7002d740cd60a306f
Gerrit-Change-Number: 5980615
Gerrit-PatchSet: 2
Gerrit-Owner: Dan Zhang <da...@chromium.org>
Gerrit-CC: Dan Zhang <da...@google.com>
Gerrit-CC: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Dan Zhang <da...@chromium.org>
Gerrit-Comment-Date: Thu, 07 Nov 2024 16:17:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Dan Zhang (Gerrit)

unread,
Nov 7, 2024, 11:48:59 AM11/7/24
to Dan Zhang, Ryan Hamilton, Tricium, chromium...@chromium.org, net-r...@chromium.org
Attention needed from Dan Zhang

Dan Zhang added 1 comment

File net/quic/quic_network_change_observer.cc
Line 493, Patchset 2 (Latest): if (!static_cast<net::QuicChromiumClientSession&>(session_.get())
Ryan Hamilton . unresolved

Since we're targeting this code to live in QUICHE, I don't think we can directly reference Chromium classes?

Dan Zhang

The plan is to add a new interface MigrateToNewPath() in QuicSession. Actually all the down casting to Chromium objects in this class means that the corresponding interfaces needs to be made into QUICHE interface.

Open in Gerrit

Related details

Attention is currently required from:
  • Dan Zhang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I59f663699a63754a7cf04bd7002d740cd60a306f
Gerrit-Change-Number: 5980615
Gerrit-PatchSet: 2
Gerrit-Owner: Dan Zhang <da...@chromium.org>
Gerrit-CC: Dan Zhang <da...@google.com>
Gerrit-CC: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Dan Zhang <da...@chromium.org>
Gerrit-Comment-Date: Thu, 07 Nov 2024 16:48:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ryan Hamilton <r...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Dan Zhang (Gerrit)

unread,
Nov 11, 2024, 10:21:28 PM11/11/24
to Ryan Hamilton, Tricium, chromium...@chromium.org, Dan Zhang, net-r...@chromium.org
Attention needed from Ryan Hamilton

Dan Zhang added 8 comments

File net/quic/platform/impl/quic_chromium_net_log.h
Line 13, Patchset 2:class NET_EXPORT_PRIVATE QuicChromiumNetLog : public quic::QuicEventLog {
Ryan Hamilton . resolved

I definitely don't think we should make a Chrome net log platform API. Instead, I think we should add various `OnFooHappened()` debug visitor methods which pass up the relevant information that Chrome-specific code can add to net-log.

Dan Zhang

Added DebugVisitor interface for this.

File net/quic/quic_network_change_observer.h
Line 258, Patchset 2: const bool migrate_session_on_network_change_;
Ryan Hamilton . resolved

It looks like a number of these fields are also in QuicNetworkChangeParameters. How 'bout we just store this struct in a member instead of duplicating?

Dan Zhang

Done

Line 89, Patchset 2:class QUICHE_EXPORT QuicNetworkChangeObserver {
Ryan Hamilton . resolved

As discussed yesterday this seems like a "MigrationManager" more than a "NetworkChangeObserver"

Dan Zhang

Renamed it to QuicConnectionMigrationManager.

Line 72, Patchset 2: bool migrate_session_early;
Ryan Hamilton . resolved

nit: brief comments for each of these. For example, what does "Early" mean here?

Dan Zhang

Done

Line 66, Patchset 2:struct QuicNetworkChangeParameters {
Ryan Hamilton . resolved

nit: If I understand this correctly, this is a collection of configuration variables for migration behavior. Is that right? If so maybe "QuicConnectionMigrationConfiguration" or some such.

Dan Zhang

Done

File net/quic/quic_network_change_observer.cc
Line 242, Patchset 2: net_log_->AddEventWithInt64Params(
Ryan Hamilton . resolved

Just reiterating my earlier point, instead of having a NetLog platform API for this, let's instead have a DebugVisitor (or something) for this class. Here we could call something like `debug_visitor_.OnNetworkConnected(QuicNetworkHandle network)`. Then the Chromium implementation can send this to the NetLog. This is how net/quic/quic_connection_logger.h works today.

Dan Zhang

Done

File net/quic/quic_path_context_manager.h
Line 58, Patchset 2: virtual void CreatePathValidationContext(
Ryan Hamilton . resolved

Comment for this method. It sorta seems like it's a factory method but I don't think I understand what it's expected to do.

Dan Zhang

Done

Line 29, Patchset 2:class QUICHE_EXPORT QuicPathContextManager {
Ryan Hamilton . resolved

Class comment, please. I'm not clear how this is intended to be used.

Dan Zhang

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Ryan Hamilton
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I59f663699a63754a7cf04bd7002d740cd60a306f
Gerrit-Change-Number: 5980615
Gerrit-PatchSet: 5
Gerrit-Owner: Dan Zhang <da...@chromium.org>
Gerrit-CC: Dan Zhang <da...@google.com>
Gerrit-CC: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Ryan Hamilton <r...@chromium.org>
Gerrit-Comment-Date: Tue, 12 Nov 2024 03:21:22 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Ryan Hamilton (Gerrit)

unread,
Nov 12, 2024, 1:40:29 AM11/12/24
to Dan Zhang, Ryan Hamilton, Tricium, chromium...@chromium.org, Dan Zhang, net-r...@chromium.org
Attention needed from Dan Zhang

Ryan Hamilton added 21 comments

Patchset-level comments
File-level comment, Patchset 6 (Latest):
Ryan Hamilton . resolved

A few more comments. I think we definitely need unit tests for the "quiche" classes.

File net/quic/quic_chromium_path_context_manager.cc
Line 69, Patchset 6 (Latest): shared_completion_callback = completion_callback.lock();
Ryan Hamilton . unresolved

Since completion_callback is a weak pointer, it's possible that this will return nullptr if the weak pointer is expired. This seems problematic.

File net/quic/quic_connection_migration_manager.h
Line 334, Patchset 6 (Latest): std::shared_ptr<QuicPathContextManager::PathValidationContextCreationCallback>
Ryan Hamilton . unresolved

Do we need this to be a shared pointer or is there some way to work around that? I'm not sure what the motivation for reference counting is here.

Line 197, Patchset 6 (Latest): }
Ryan Hamilton . unresolved

optional: consider moving all the simple getters down to the bottom of the list of methods

Line 195, Patchset 6 (Latest): bool quic_connection_migration_successful() const {
Ryan Hamilton . unresolved

ditto

Line 191, Patchset 6 (Latest): bool quic_connection_migration_attempted() const {
Ryan Hamilton . unresolved

nit: how 'bout just `migration_attempted` since the "quic connection" prefix is a bit redundant?

Line 189, Patchset 6 (Latest): QuicNetworkHandle GetDefaultNetwork() const { return default_network_; }
Ryan Hamilton . unresolved

Since these are simple getters should they simply be `default_network()`?

Line 145, Patchset 6 (Latest): quic::QuicSpdyClientSessionBase* session,
Ryan Hamilton . unresolved

For all of these pointers can we use absl Nullability annotations? go/totw/230

Line 103, Patchset 6 (Latest): virtual ~QuicConnectionMigrationDebugVisitor() {}
Ryan Hamilton . unresolved

use '= default' to define a trivial destructor (https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html)

(Note: running clang-tidy on this file failed; this diagnostic might be incorrect as a result.)

(Lint observed on `android-clang-tidy-rel` and `linux-clang-tidy-rel`)

Please fix.

Line 72, Patchset 6 (Latest): bool migrate_session_on_network_change;
Ryan Hamilton . unresolved

Would it make sense to set the default values for these members in the .h file?

File net/quic/quic_connection_migration_manager.cc
Line 164, Patchset 6 (Latest):QuicConnectionMigrationConfig::QuicConnectionMigrationConfig() = default;
Ryan Hamilton . unresolved

I think this leaves the POD members uninitialized. Is that expected?

Line 166, Patchset 6 (Latest): const QuicConnectionMigrationConfig&) = default;
Ryan Hamilton . unresolved

Can we just do `= default` in the .h file for all 3 of these methods?

Line 193, Patchset 6 (Latest): run_pending_callbacks_alarm_ =
Ryan Hamilton . unresolved

Can these be initialized in the initializer list instead of the constructor body?

Line 201, Patchset 6 (Latest): run_pending_callbacks_alarm_->PermanentCancel();
Ryan Hamilton . unresolved

Is this necessary, or does the `QuicAlarm` destructor do the right thing?

File net/quic/quic_path_context_manager.h
Line 64, Patchset 6 (Latest): // validation context, or with nullptr if this manager fail to create one.
Ryan Hamilton . unresolved

If `completion_callback` is only used to invoke the `OnPathValidationContextCreated()` method, can we pass in `absl::AnyInvokable`, or some such? (go/totw/191)

I'm also unclear why this needs to be a weak_ptr. I would think that could be handled, perhaps, in the subclass of `PathValidationContextCreationCallback`.

Line 55, Patchset 6 (Latest): done_callback_;
Ryan Hamilton . unresolved

How is this member expected to be used?

Line 47, Patchset 6 (Latest): QuicSession& session() { return session_.get(); }
Ryan Hamilton . unresolved

Why is this needed?

Line 45, Patchset 6 (Latest): absl::string_view error);
Ryan Hamilton . unresolved

Please document these arguments. In particular, is `context` guaranteed to be non-null? Or will it be null if there is an error. Ditto about `error`. I wonder if there should be two methods, one for success which takes a non-null context, and one for error which takes an error message.

Line 33, Patchset 6 (Latest): class PathValidationContextCreationCallback {
Ryan Hamilton . unresolved

If we need to keep this as a class, how 'bout naming it something like `Delegate`. Since it's nested class, it would be `QuicPathContextFactory::Delegate` for external uses.

In any case, please comment on this class. From reading the declaration here, I'm quite unclear how it is used. Specifically, this object is created with a `done_callback` but it's not obvious to me why that is needed/what it does.

Line 31, Patchset 6 (Latest):class QUICHE_EXPORT QuicPathContextManager {
Ryan Hamilton . unresolved

If this is simply a class for creating objects, then "Factory" would be a good design pattern name. So perhaps `QuicPathContextFactory`?

Line 27, Patchset 6 (Latest):inline constexpr QuicNetworkHandle kInvalidNetworkHandle{-1};
Ryan Hamilton . unresolved

nit: ` = -1;` to be simpler.

https://abseil.io/tips/88

Open in Gerrit

Related details

Attention is currently required from:
  • Dan Zhang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I59f663699a63754a7cf04bd7002d740cd60a306f
Gerrit-Change-Number: 5980615
Gerrit-PatchSet: 6
Gerrit-Owner: Dan Zhang <da...@chromium.org>
Gerrit-CC: Dan Zhang <da...@google.com>
Gerrit-CC: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Dan Zhang <da...@chromium.org>
Gerrit-Comment-Date: Tue, 12 Nov 2024 06:40:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Dan Zhang (Gerrit)

unread,
Nov 12, 2024, 11:11:06 AM11/12/24
to Ryan Hamilton, Tricium, chromium...@chromium.org, Dan Zhang, net-r...@chromium.org
Attention needed from Ryan Hamilton

Dan Zhang added 7 comments

File net/quic/quic_chromium_path_context_manager.cc
Line 69, Patchset 6 (Latest): shared_completion_callback = completion_callback.lock();
Ryan Hamilton . resolved

Since completion_callback is a weak pointer, it's possible that this will return nullptr if the weak pointer is expired. This seems problematic.

Dan Zhang

This is called right after the caller created the callback object, so it's impossible that it becomes expired right away, thus the DCHECK above.

File net/quic/quic_connection_migration_manager.h
Line 334, Patchset 6 (Latest): std::shared_ptr<QuicPathContextManager::PathValidationContextCreationCallback>
Ryan Hamilton . resolved

Do we need this to be a shared pointer or is there some way to work around that? I'm not sure what the motivation for reference counting is here.

Dan Zhang

This is for the weak_ptr of completion_callback passed into QuicPathContextManager, given that the path context creation can be async.

File net/quic/quic_connection_migration_manager.cc
Line 166, Patchset 6 (Latest): const QuicConnectionMigrationConfig&) = default;
Ryan Hamilton . resolved

Can we just do `= default` in the .h file for all 3 of these methods?

Dan Zhang

I ran into compilation errors if inlining the definition of these constructors and destructor, which looks like Chromium specific. I can try to inline them once moving these classes into QUICHE.

Line 201, Patchset 6 (Latest): run_pending_callbacks_alarm_->PermanentCancel();
Ryan Hamilton . resolved

Is this necessary, or does the `QuicAlarm` destructor do the right thing?

Dan Zhang

~QuicAlarm() doesn't cancel itself given cancellation implementation is in subclasses. But it does increment a code counter if itself is not cancelled. So it's better we explicit cancel all the alarms like what QuicConnection does.

File net/quic/quic_path_context_manager.h
Line 64, Patchset 6 (Latest): // validation context, or with nullptr if this manager fail to create one.
Ryan Hamilton . unresolved

If `completion_callback` is only used to invoke the `OnPathValidationContextCreated()` method, can we pass in `absl::AnyInvokable`, or some such? (go/totw/191)

I'm also unclear why this needs to be a weak_ptr. I would think that could be handled, perhaps, in the subclass of `PathValidationContextCreationCallback`.

Dan Zhang

We can use absl::AnyInvokable to replace the std::function done_callback_ inside this class, but the reason why we wrap the actual callback inside PathValidationContextCreationCallback and pass in a weak_ptr of it here is because this call can be async, and its caller which owns the completion_callback may gets destructed before CreatePathValidationContext() is called. And PathValidationContextCreationCallback can also retain a handle to the session object.

Ryan Hamilton . unresolved

How is this member expected to be used?

Dan Zhang

This is called after a path context object is created to pass it back to QuicConnectionMigrationManager. This might be a function to kick off path validation or immediate migration depending on where it is called.

Line 47, Patchset 6 (Latest): QuicSession& session() { return session_.get(); }
Ryan Hamilton . unresolved

Why is this needed?

Dan Zhang

QuicChromiumPathContextManager::CreatePathValidationContextWithSocket() needs to access the chromium session object for net log and to create chromium packet reader. Wrapping it into PathValidationContextCreationCallback is just a convenient way of passing the session object around given its life time is already managed.

Open in Gerrit

Related details

Attention is currently required from:
  • Ryan Hamilton
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I59f663699a63754a7cf04bd7002d740cd60a306f
Gerrit-Change-Number: 5980615
Gerrit-PatchSet: 6
Gerrit-Owner: Dan Zhang <da...@chromium.org>
Gerrit-CC: Dan Zhang <da...@google.com>
Gerrit-CC: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Ryan Hamilton <r...@chromium.org>
Gerrit-Comment-Date: Tue, 12 Nov 2024 16:10:56 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Dan Zhang (Gerrit)

unread,
Nov 15, 2024, 3:31:22 PM11/15/24
to Ali Beyad, Ryan Hamilton, Tricium, chromium...@chromium.org, Dan Zhang, net-r...@chromium.org
Attention needed from Ryan Hamilton

Dan Zhang added 14 comments

File net/quic/quic_connection_migration_manager.h
Line 197, Patchset 6: }
Ryan Hamilton . resolved

optional: consider moving all the simple getters down to the bottom of the list of methods

Dan Zhang

Done

Line 195, Patchset 6: bool quic_connection_migration_successful() const {
Ryan Hamilton . resolved

ditto

Dan Zhang

Done

Line 191, Patchset 6: bool quic_connection_migration_attempted() const {
Ryan Hamilton . resolved

nit: how 'bout just `migration_attempted` since the "quic connection" prefix is a bit redundant?

Dan Zhang

Done

Line 189, Patchset 6: QuicNetworkHandle GetDefaultNetwork() const { return default_network_; }
Ryan Hamilton . resolved

Since these are simple getters should they simply be `default_network()`?

Dan Zhang

Done

Line 145, Patchset 6: quic::QuicSpdyClientSessionBase* session,
Ryan Hamilton . resolved

For all of these pointers can we use absl Nullability annotations? go/totw/230

Dan Zhang

Done

Line 103, Patchset 6: virtual ~QuicConnectionMigrationDebugVisitor() {}
Ryan Hamilton . resolved

use '= default' to define a trivial destructor (https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html)

(Note: running clang-tidy on this file failed; this diagnostic might be incorrect as a result.)

(Lint observed on `android-clang-tidy-rel` and `linux-clang-tidy-rel`)

Please fix.

Dan Zhang

Done

Line 72, Patchset 6: bool migrate_session_on_network_change;
Ryan Hamilton . resolved

Would it make sense to set the default values for these members in the .h file?

Dan Zhang

Done

File net/quic/quic_connection_migration_manager.cc
Line 164, Patchset 6:QuicConnectionMigrationConfig::QuicConnectionMigrationConfig() = default;
Ryan Hamilton . resolved

I think this leaves the POD members uninitialized. Is that expected?

Dan Zhang

I initialized them with some sort of defaults now.

Line 193, Patchset 6: run_pending_callbacks_alarm_ =
Ryan Hamilton . resolved

Can these be initialized in the initializer list instead of the constructor body?

Dan Zhang

Done

File net/quic/quic_path_context_manager.h
Line 47, Patchset 6: QuicSession& session() { return session_.get(); }
Ryan Hamilton . resolved

Why is this needed?

Dan Zhang

QuicChromiumPathContextManager::CreatePathValidationContextWithSocket() needs to access the chromium session object for net log and to create chromium packet reader. Wrapping it into PathValidationContextCreationCallback is just a convenient way of passing the session object around given its life time is already managed.

Dan Zhang

Not needed any more after this class being made per session

Line 45, Patchset 6: absl::string_view error);
Ryan Hamilton . resolved

Please document these arguments. In particular, is `context` guaranteed to be non-null? Or will it be null if there is an error. Ditto about `error`. I wonder if there should be two methods, one for success which takes a non-null context, and one for error which takes an error message.

Dan Zhang

Done

Line 33, Patchset 6: class PathValidationContextCreationCallback {
Ryan Hamilton . resolved

If we need to keep this as a class, how 'bout naming it something like `Delegate`. Since it's nested class, it would be `QuicPathContextFactory::Delegate` for external uses.

In any case, please comment on this class. From reading the declaration here, I'm quite unclear how it is used. Specifically, this object is created with a `done_callback` but it's not obvious to me why that is needed/what it does.

Dan Zhang

Done

Line 31, Patchset 6:class QUICHE_EXPORT QuicPathContextManager {
Ryan Hamilton . resolved

If this is simply a class for creating objects, then "Factory" would be a good design pattern name. So perhaps `QuicPathContextFactory`?

Dan Zhang

Done

Line 27, Patchset 6:inline constexpr QuicNetworkHandle kInvalidNetworkHandle{-1};
Ryan Hamilton . resolved

nit: ` = -1;` to be simpler.

https://abseil.io/tips/88

Dan Zhang

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Ryan Hamilton
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I59f663699a63754a7cf04bd7002d740cd60a306f
Gerrit-Change-Number: 5980615
Gerrit-PatchSet: 9
Gerrit-Owner: Dan Zhang <da...@chromium.org>
Gerrit-CC: Ali Beyad <abe...@google.com>
Gerrit-CC: Dan Zhang <da...@google.com>
Gerrit-CC: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Ryan Hamilton <r...@chromium.org>
Gerrit-Comment-Date: Fri, 15 Nov 2024 20:31:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ryan Hamilton <r...@chromium.org>
Comment-In-Reply-To: Dan Zhang <da...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Dan Zhang (Gerrit)

unread,
Nov 26, 2024, 12:28:05 PM11/26/24
to Dan Zhang, Ali Beyad, Ryan Hamilton, Tricium, chromium...@chromium.org, net-r...@chromium.org
Attention needed from Dan Zhang and Ryan Hamilton

Dan Zhang added 3 comments

Patchset-level comments
File-level comment, Patchset 6:
Ryan Hamilton . resolved

A few more comments. I think we definitely need unit tests for the "quiche" classes.

Dan Zhang

I added some unit tests for migration manager, will continue working on more test cases.

File net/quic/quic_connection_migration_manager.h
Line 103, Patchset 6: virtual ~QuicConnectionMigrationDebugVisitor() {}
Ryan Hamilton . resolved

use '= default' to define a trivial destructor (https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html)

(Note: running clang-tidy on this file failed; this diagnostic might be incorrect as a result.)

(Lint observed on `android-clang-tidy-rel` and `linux-clang-tidy-rel`)

Please fix.

Dan Zhang

Done

File net/quic/quic_path_context_manager.h
Line 47, Patchset 6: QuicSession& session() { return session_.get(); }
Ryan Hamilton . resolved

Why is this needed?

Dan Zhang

QuicChromiumPathContextManager::CreatePathValidationContextWithSocket() needs to access the chromium session object for net log and to create chromium packet reader. Wrapping it into PathValidationContextCreationCallback is just a convenient way of passing the session object around given its life time is already managed.

Dan Zhang

I made this interface to not use weak_ptr instead.

Open in Gerrit

Related details

Attention is currently required from:
  • Dan Zhang
  • Ryan Hamilton
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I59f663699a63754a7cf04bd7002d740cd60a306f
Gerrit-Change-Number: 5980615
Gerrit-PatchSet: 11
Gerrit-Owner: Dan Zhang <da...@chromium.org>
Gerrit-CC: Ali Beyad <abe...@google.com>
Gerrit-CC: Dan Zhang <da...@google.com>
Gerrit-CC: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Dan Zhang <da...@chromium.org>
Gerrit-Comment-Date: Tue, 26 Nov 2024 17:27:59 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Dan Zhang (Gerrit)

unread,
Dec 5, 2024, 2:29:03 PM12/5/24
to Dan Zhang, Ali Beyad, Ryan Hamilton, Tricium, chromium...@chromium.org, net-r...@chromium.org
Attention needed from Dan Zhang and Ryan Hamilton

Dan Zhang added 1 comment

Patchset-level comments
File-level comment, Patchset 12:
Dan Zhang . resolved

Friendly ping on this?

Open in Gerrit

Related details

Attention is currently required from:
  • Dan Zhang
  • Ryan Hamilton
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I59f663699a63754a7cf04bd7002d740cd60a306f
Gerrit-Change-Number: 5980615
Gerrit-PatchSet: 12
Gerrit-Owner: Dan Zhang <da...@chromium.org>
Gerrit-CC: Ali Beyad <abe...@google.com>
Gerrit-CC: Dan Zhang <da...@google.com>
Gerrit-CC: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Dan Zhang <da...@chromium.org>
Gerrit-Comment-Date: Thu, 05 Dec 2024 19:28:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Ryan Hamilton (Gerrit)

unread,
Dec 6, 2024, 5:05:09 PM12/6/24
to Dan Zhang, Ali Beyad, Ryan Hamilton, Tricium, chromium...@chromium.org, Dan Zhang, net-r...@chromium.org
Attention needed from Dan Zhang

Ryan Hamilton added 22 comments

Patchset-level comments
File-level comment, Patchset 14 (Latest):
Ryan Hamilton . resolved

Ok, I think we're getting there! The tests, in particular, look promising.

File net/quic/quic_connection_migration_manager.h
Line 432, Patchset 14 (Latest): QuicConnectionMigrationManager* migration_manager() {
Ryan Hamilton . unresolved

Since this is always non-null can this return a non-const ref?

Line 424, Patchset 14 (Latest): virtual bool PrepareForMigratingToPath(
Ryan Hamilton . unresolved

nit: "ForMigrating" => "ForMigration" to be consistent with "OnMigrationToPathDone".

Line 410, Patchset 14 (Latest): // network.
Ryan Hamilton . unresolved

Since this method potentially changes the network, but `QuicPathValidationContext` does not include the network handle, this method should probably take a `QuicClientPathValidationContext`.

Line 214, Patchset 14 (Latest): // Called when probing the server's preferred address from a differnt port
Ryan Hamilton . unresolved

"differnt" is a possible misspelling of "different".

Please fix.

Line 163, Patchset 14 (Latest): // Called when NetworkChangeNotifier notifies observers of a newly
Ryan Hamilton . unresolved

nit: I think `NetworkChangeNotifier` is Chrome-specific so we probably want to rephrase this (and other) comment to say something like:

Called when a new network is connected by the operating system...

(or some such)

File net/quic/quic_connection_migration_manager.cc
Line 81, Patchset 14 (Latest):// migration.
Ryan Hamilton . unresolved

Is this specifically for probe-based migration? If so, let's mention that.

Line 102, Patchset 14 (Latest): // |migration_manager_| should out live |this|.
Ryan Hamilton . unresolved

Would be good to mention this in the constructor comment.

Line 192, Patchset 14 (Latest):QuicConnectionMigrationConfig::~QuicConnectionMigrationConfig() = default;
Ryan Hamilton . unresolved

Maybe we can move this to a stand-alone .cc file to make this one smaller. (or just put these in the .h file)

Line 287, Patchset 14 (Latest): auto* context = static_cast<QuicClientPathValidationContext*>(
Ryan Hamilton . unresolved

I'm probably missing something, but what ensure that the connection's context is a `QuicClientPathValidationContext`?

Line 1553, Patchset 14 (Latest):QuicSpdyClientSessionWithMigration::QuicSpdyClientSessionWithMigration(
Ryan Hamilton . unresolved

Maybe we can move this to a stand-alone .cc file to make this one smaller.

Line 1605, Patchset 14 (Latest): static_cast<QuicClientPathValidationContext&>(*path_context)
Ryan Hamilton . unresolved

I think that perhaps this method should take a `QuicClientPathValidationContext` instead of a `QuicPathValidationContext` so that this cast is not needed.

File net/quic/quic_connection_migration_manager_test.cc
Line 695, Patchset 14 (Latest):// migrated session back to the default network. Migration singals delivered
Ryan Hamilton . unresolved

"singals" is a possible misspelling of "signals".

Please fix.

Line 696, Patchset 14 (Latest):// in the following order (alternate network is always availabe):
Ryan Hamilton . unresolved

"availabe" is a possible misspelling of "available".

Please fix.

File net/quic/quic_force_blockable_packet_writer.h
Line 19, Patchset 14 (Latest): virtual void ForceWriteBlockage(bool write_blocked) = 0;
Ryan Hamilton . unresolved

nit: "Blockage" => "Blocked", I think.

Line 12, Patchset 14 (Latest):class QUICHE_EXPORT QuicForceBlockablePacketWriter : public QuicPacketWriter {
Ryan Hamilton . unresolved

nit: Brief class comment, please.

File net/quic/quic_path_context_factory.h
Line 81, Patchset 14 (Latest): // |completion_callback|.OnPathValidationContextCreated() can be called either
Ryan Hamilton . unresolved

Should this method take a `completion_callback`, or should the comment be modified to say reference `result_delegate` instead?

Line 70, Patchset 14 (Latest): // session_ should outlive the callback.
Ryan Hamilton . unresolved

nit: What is `session_`?

Line 67, Patchset 14 (Latest): absl::string_view error);
Ryan Hamilton . unresolved

Instead of having CreationResultDelegate be a concrete class which takes a Callback as an argument, what about having this class be an interface with pure virtual `OnCreation()` methods. Then the caller can create a subclass of this interface with whatever logic they need. That might eliminate a bit of redundant layering.

Alternatively, we could remove this class completely and just pass the callback into `CreatePathValidationContext()` directly (though I think the delegate route is probably a bit cleaner).

Line 64, Patchset 14 (Latest): // in which case |error| will be populated with details.
Ryan Hamilton . unresolved

Instead of a single method with two modes and two parameters, it might make sense to have `OnCreationSucceeded(context)` and `OnCreationFailed(error)`.

Line 40, Patchset 14 (Latest): virtual bool ShouldConnectionOwnWriter() const = 0;
Ryan Hamilton . unresolved

What are the semantics of this method, and out of curiosity why is it needed?

Line 30, Patchset 14 (Latest):class QUICHE_EXPORT QuicClientPathValidationContext
Ryan Hamilton . unresolved

nit: Class comment, please. In particular the only new field in this class is the network handle, but the name is `Client`, so it would be good to explain why the network handle is client-specific.

Also, I wonder if it might make sense to name this `QuicMigrationContext` and instead of extending `QuicPathValidationContext` make it have a member of that type, since it seems a bit like composition is a better fit here than inheritance.

Open in Gerrit

Related details

Attention is currently required from:
  • Dan Zhang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I59f663699a63754a7cf04bd7002d740cd60a306f
Gerrit-Change-Number: 5980615
Gerrit-PatchSet: 14
Gerrit-Owner: Dan Zhang <da...@chromium.org>
Gerrit-CC: Ali Beyad <abe...@google.com>
Gerrit-CC: Dan Zhang <da...@google.com>
Gerrit-CC: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Dan Zhang <da...@chromium.org>
Gerrit-Comment-Date: Fri, 06 Dec 2024 22:05:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Dan Zhang (Gerrit)

unread,
Dec 8, 2024, 8:57:32 PM12/8/24
to Dan Zhang, Ali Beyad, Ryan Hamilton, Tricium, chromium...@chromium.org, net-r...@chromium.org
Attention needed from Dan Zhang and Ryan Hamilton

Dan Zhang added 24 comments

File net/quic/quic_connection_migration_manager.h
Line 432, Patchset 14 (Latest): QuicConnectionMigrationManager* migration_manager() {
Ryan Hamilton . resolved

Since this is always non-null can this return a non-const ref?

Dan Zhang

Done

Line 424, Patchset 14 (Latest): virtual bool PrepareForMigratingToPath(
Ryan Hamilton . resolved

nit: "ForMigrating" => "ForMigration" to be consistent with "OnMigrationToPathDone".

Dan Zhang

Done

Ryan Hamilton . resolved

Since this method potentially changes the network, but `QuicPathValidationContext` does not include the network handle, this method should probably take a `QuicClientPathValidationContext`.

Dan Zhang

Done

Line 214, Patchset 14 (Latest): // Called when probing the server's preferred address from a differnt port
Ryan Hamilton . resolved

"differnt" is a possible misspelling of "different".

Please fix.

Dan Zhang

Done

Line 163, Patchset 14 (Latest): // Called when NetworkChangeNotifier notifies observers of a newly
Ryan Hamilton . resolved

nit: I think `NetworkChangeNotifier` is Chrome-specific so we probably want to rephrase this (and other) comment to say something like:

Called when a new network is connected by the operating system...

(or some such)

Dan Zhang

Done

File net/quic/quic_connection_migration_manager.cc
Ryan Hamilton . resolved

Is this specifically for probe-based migration? If so, let's mention that.

Dan Zhang

Done

Line 102, Patchset 14 (Latest): // |migration_manager_| should out live |this|.
Ryan Hamilton . resolved

Would be good to mention this in the constructor comment.

Dan Zhang

Done

Line 192, Patchset 14 (Latest):QuicConnectionMigrationConfig::~QuicConnectionMigrationConfig() = default;
Ryan Hamilton . resolved

Maybe we can move this to a stand-alone .cc file to make this one smaller. (or just put these in the .h file)

Dan Zhang

Chromium doesn't allow inlined member function definition for complex classes, so I have to move even the default constructor and destructor into .cc to avoid chromium specific build error. But once the code gets moved into QUICHE, we can inline them.

Line 287, Patchset 14 (Latest): auto* context = static_cast<QuicClientPathValidationContext*>(
Ryan Hamilton . resolved

I'm probably missing something, but what ensure that the connection's context is a `QuicClientPathValidationContext`?

Dan Zhang

This is in OnNetworkDisconnected(), so it's a client connection. Any on-going path validation's context is provided by the context factory and thus guaranteed to be a QuicClientPathValidationContext.

Line 1553, Patchset 14 (Latest):QuicSpdyClientSessionWithMigration::QuicSpdyClientSessionWithMigration(
Ryan Hamilton . resolved

Maybe we can move this to a stand-alone .cc file to make this one smaller.

Dan Zhang

Done

Line 1605, Patchset 14 (Latest): static_cast<QuicClientPathValidationContext&>(*path_context)
Ryan Hamilton . resolved

I think that perhaps this method should take a `QuicClientPathValidationContext` instead of a `QuicPathValidationContext` so that this cast is not needed.

Dan Zhang

Done

File net/quic/quic_connection_migration_manager_test.cc
Line 695, Patchset 14 (Latest):// migrated session back to the default network. Migration singals delivered
Ryan Hamilton . resolved

"singals" is a possible misspelling of "signals".

Please fix.

Dan Zhang

Done

Line 696, Patchset 14 (Latest):// in the following order (alternate network is always availabe):
Ryan Hamilton . resolved

"availabe" is a possible misspelling of "available".

Please fix.

Dan Zhang

Done

File net/quic/quic_force_blockable_packet_writer.h
Line 19, Patchset 14 (Latest): virtual void ForceWriteBlockage(bool write_blocked) = 0;
Ryan Hamilton . unresolved

nit: "Blockage" => "Blocked", I think.

Dan Zhang

The bool argument, when false, will undo any previous force blocking. Naming it ForceWriteBlocked() is misleading. Admittedly the current name sounds weird too...

Line 12, Patchset 14 (Latest):class QUICHE_EXPORT QuicForceBlockablePacketWriter : public QuicPacketWriter {
Ryan Hamilton . resolved

nit: Brief class comment, please.

Dan Zhang

Done

File net/quic/quic_network_change_observer.cc
Line 3, Patchset 2:// found in the LICENSE file.
Ryan Hamilton . resolved

There is a LOT of new code here, and no unit tests. I think we should figure out how to write tests for this.

Dan Zhang

Done

Line 493, Patchset 2: if (!static_cast<net::QuicChromiumClientSession&>(session_.get())
Ryan Hamilton . resolved

Since we're targeting this code to live in QUICHE, I don't think we can directly reference Chromium classes?

Dan Zhang

The plan is to add a new interface MigrateToNewPath() in QuicSession. Actually all the down casting to Chromium objects in this class means that the corresponding interfaces needs to be made into QUICHE interface.

Dan Zhang

I believe the extracted code no longer references chromium classes any more.

File net/quic/quic_path_context_factory.h
Line 81, Patchset 14 (Latest): // |completion_callback|.OnPathValidationContextCreated() can be called either
Ryan Hamilton . resolved

Should this method take a `completion_callback`, or should the comment be modified to say reference `result_delegate` instead?

Dan Zhang

Updated the comment

Line 70, Patchset 14 (Latest): // session_ should outlive the callback.
Ryan Hamilton . resolved

nit: What is `session_`?

Dan Zhang

Outdated and removed.

Line 67, Patchset 14 (Latest): absl::string_view error);
Ryan Hamilton . resolved

Instead of having CreationResultDelegate be a concrete class which takes a Callback as an argument, what about having this class be an interface with pure virtual `OnCreation()` methods. Then the caller can create a subclass of this interface with whatever logic they need. That might eliminate a bit of redundant layering.

Alternatively, we could remove this class completely and just pass the callback into `CreatePathValidationContext()` directly (though I think the delegate route is probably a bit cleaner).

Dan Zhang

Changed it into an abstract interface which is cleaner to me.

Line 64, Patchset 14 (Latest): // in which case |error| will be populated with details.
Ryan Hamilton . resolved

Instead of a single method with two modes and two parameters, it might make sense to have `OnCreationSucceeded(context)` and `OnCreationFailed(error)`.

Dan Zhang

Done

Line 40, Patchset 14 (Latest): virtual bool ShouldConnectionOwnWriter() const = 0;
Ryan Hamilton . unresolved

What are the semantics of this method, and out of curiosity why is it needed?

Dan Zhang

QuicConnection might not necessarily owns the writer. It's up to the platform specific code to call into its constructor. So when we call MigrateToPath() on it during migration, we also need to be consistent about the ownership of the new writer. Currently this method takes a bool to indicate whether connection should take the ownership. Since the path context also has its platform-specific implementation, I think it's a good place to retain the writer ownership preference here. In Chromium, QuicConnection will take the ownership of the initial writer and all the newer writers after migration.

Line 30, Patchset 14 (Latest):class QUICHE_EXPORT QuicClientPathValidationContext
Ryan Hamilton . unresolved

nit: Class comment, please. In particular the only new field in this class is the network handle, but the name is `Client`, so it would be good to explain why the network handle is client-specific.

Also, I wonder if it might make sense to name this `QuicMigrationContext` and instead of extending `QuicPathValidationContext` make it have a member of that type, since it seems a bit like composition is a better fit here than inheritance.

Dan Zhang

The down side of composition is that network handle won't be passed along during async path validation as the current interface takes a QuicPathValidationContext object.

File net/quic/quic_path_context_manager.h
Line 64, Patchset 6: // validation context, or with nullptr if this manager fail to create one.
Ryan Hamilton . resolved

If `completion_callback` is only used to invoke the `OnPathValidationContextCreated()` method, can we pass in `absl::AnyInvokable`, or some such? (go/totw/191)

I'm also unclear why this needs to be a weak_ptr. I would think that could be handled, perhaps, in the subclass of `PathValidationContextCreationCallback`.

Dan Zhang

We can use absl::AnyInvokable to replace the std::function done_callback_ inside this class, but the reason why we wrap the actual callback inside PathValidationContextCreationCallback and pass in a weak_ptr of it here is because this call can be async, and its caller which owns the completion_callback may gets destructed before CreatePathValidationContext() is called. And PathValidationContextCreationCallback can also retain a handle to the session object.

Dan Zhang

Removed the usage of weak_ptr in favor of making the session own the context factory.

Open in Gerrit

Related details

Attention is currently required from:
  • Dan Zhang
  • Ryan Hamilton
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I59f663699a63754a7cf04bd7002d740cd60a306f
Gerrit-Change-Number: 5980615
Gerrit-PatchSet: 14
Gerrit-Owner: Dan Zhang <da...@chromium.org>
Gerrit-CC: Ali Beyad <abe...@google.com>
Gerrit-CC: Dan Zhang <da...@google.com>
Gerrit-CC: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Dan Zhang <da...@chromium.org>
Gerrit-Comment-Date: Mon, 09 Dec 2024 01:57:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Dan Zhang <da...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Ali Beyad (Gerrit)

unread,
Dec 10, 2024, 1:50:27 PM12/10/24
to Dan Zhang, Ryan Hamilton, Tricium, chromium...@chromium.org, Dan Zhang, net-r...@chromium.org
Attention needed from Dan Zhang and Ryan Hamilton

Ali Beyad added 6 comments

File net/quic/quic_chromium_client_session.h
Line 778, Patchset 10: const DatagramClientSocket* GetDefaultSocket() const;
Ali Beyad . unresolved

same here, this just seems moved around, if we can put it back in the original order so it doesn't show up in the diff?

Line 749, Patchset 10: quic::QuicTimeDelta TimeSinceLastStreamClose() override;
Ali Beyad . unresolved

these new functions could use comments

Line 747, Patchset 10: void WriteToNewSocket();
Ali Beyad . unresolved

this seems unchanged, just moved around, can we put it back in the same order so it doesn't show up in the diff?

Line 529, Patchset 10: bool migrate_sessions_on_network_change_v2,
Ali Beyad . unresolved

nit: this CL already has a lot going on, so we should probably save other improvements like this one (thanks for spotting and fixing this btw!) into a separate CL.

File net/quic/quic_connection_migration_manager.h
Line 103, Patchset 10:class QUIC_EXPORT QuicConnectionMigrationDebugVisitor {
Ali Beyad . unresolved

is

File net/quic/quic_connection_migration_manager.cc
Line 1537, Patchset 10:void QuicSpdyClientSessionWithMigration::SetMigrationDebugVisitor(
Ali Beyad . unresolved

what is the purpose of the QuicConnectionMigrationDebugVisitor? I don't see it used anywhere.

Open in Gerrit

Related details

Attention is currently required from:
  • Dan Zhang
  • Ryan Hamilton
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I59f663699a63754a7cf04bd7002d740cd60a306f
Gerrit-Change-Number: 5980615
Gerrit-PatchSet: 16
Gerrit-Owner: Dan Zhang <da...@chromium.org>
Gerrit-CC: Ali Beyad <abe...@google.com>
Gerrit-CC: Dan Zhang <da...@google.com>
Gerrit-CC: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Dan Zhang <da...@chromium.org>
Gerrit-Comment-Date: Tue, 10 Dec 2024 18:50:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Dan Zhang (Gerrit)

unread,
Dec 11, 2024, 10:05:27 PM12/11/24
to Dan Zhang, Ali Beyad, Ryan Hamilton, Tricium, chromium...@chromium.org, net-r...@chromium.org
Attention needed from Ali Beyad, Dan Zhang and Ryan Hamilton

Dan Zhang added 7 comments

File net/quic/quic_chromium_client_session.h
Line 778, Patchset 10: const DatagramClientSocket* GetDefaultSocket() const;
Ali Beyad . resolved

same here, this just seems moved around, if we can put it back in the original order so it doesn't show up in the diff?

Dan Zhang

Done

Line 749, Patchset 10: quic::QuicTimeDelta TimeSinceLastStreamClose() override;
Ali Beyad . resolved

these new functions could use comments

Dan Zhang

The comment is added to the virtual interface. Here are just the implementations.

File net/quic/quic_connection_migration_manager.h
Line 103, Patchset 10:class QUIC_EXPORT QuicConnectionMigrationDebugVisitor {
Ali Beyad . unresolved

is

Dan Zhang

typo?

File net/quic/quic_connection_migration_manager.cc
Line 1537, Patchset 10:void QuicSpdyClientSessionWithMigration::SetMigrationDebugVisitor(
Ali Beyad . resolved

what is the purpose of the QuicConnectionMigrationDebugVisitor? I don't see it used anywhere.

Dan Zhang

It is the chromium net log. See quic_connection_logger.h

File net/quic/quic_force_blockable_packet_writer.h
Line 19, Patchset 14: virtual void ForceWriteBlockage(bool write_blocked) = 0;
Ryan Hamilton . unresolved

nit: "Blockage" => "Blocked", I think.

Dan Zhang

The bool argument, when false, will undo any previous force blocking. Naming it ForceWriteBlocked() is misleading. Admittedly the current name sounds weird too...

Dan Zhang

Any thoughts on this?

File net/quic/quic_path_context_factory.h
Line 40, Patchset 14: virtual bool ShouldConnectionOwnWriter() const = 0;
Ryan Hamilton . resolved

What are the semantics of this method, and out of curiosity why is it needed?

Dan Zhang

QuicConnection might not necessarily owns the writer. It's up to the platform specific code to call into its constructor. So when we call MigrateToPath() on it during migration, we also need to be consistent about the ownership of the new writer. Currently this method takes a bool to indicate whether connection should take the ownership. Since the path context also has its platform-specific implementation, I think it's a good place to retain the writer ownership preference here. In Chromium, QuicConnection will take the ownership of the initial writer and all the newer writers after migration.

Dan Zhang

Same as network() discussed above.

Line 30, Patchset 14:class QUICHE_EXPORT QuicClientPathValidationContext
Ryan Hamilton . resolved

nit: Class comment, please. In particular the only new field in this class is the network handle, but the name is `Client`, so it would be good to explain why the network handle is client-specific.

Also, I wonder if it might make sense to name this `QuicMigrationContext` and instead of extending `QuicPathValidationContext` make it have a member of that type, since it seems a bit like composition is a better fit here than inheritance.

Dan Zhang

The down side of composition is that network handle won't be passed along during async path validation as the current interface takes a QuicPathValidationContext object.

Dan Zhang

Discussed offline, we will move these 2 new interfaces into the base class QuicPathValidationContext when the code get moved into QUICHE. I added TODO for this.

Open in Gerrit

Related details

Attention is currently required from:
  • Ali Beyad
  • Dan Zhang
  • Ryan Hamilton
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I59f663699a63754a7cf04bd7002d740cd60a306f
Gerrit-Change-Number: 5980615
Gerrit-PatchSet: 16
Gerrit-Owner: Dan Zhang <da...@chromium.org>
Gerrit-CC: Ali Beyad <abe...@google.com>
Gerrit-CC: Dan Zhang <da...@google.com>
Gerrit-CC: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Ali Beyad <abe...@google.com>
Gerrit-Attention: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Dan Zhang <da...@chromium.org>
Gerrit-Comment-Date: Thu, 12 Dec 2024 03:05:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Dan Zhang <da...@google.com>
Comment-In-Reply-To: Ali Beyad <abe...@google.com>
Comment-In-Reply-To: Ryan Hamilton <r...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Dan Zhang (Gerrit)

unread,
Dec 12, 2024, 10:14:00 AM12/12/24
to Dan Zhang, Ali Beyad, Ryan Hamilton, Tricium, chromium...@chromium.org, net-r...@chromium.org
Attention needed from Ali Beyad, Dan Zhang and Ryan Hamilton

Dan Zhang added 2 comments

File net/quic/quic_chromium_client_session.h
Line 747, Patchset 10: void WriteToNewSocket();
Ali Beyad . resolved

this seems unchanged, just moved around, can we put it back in the same order so it doesn't show up in the diff?

Dan Zhang

Done

File net/quic/quic_path_context_manager.h
Line 55, Patchset 6: done_callback_;
Ryan Hamilton . resolved

How is this member expected to be used?

Dan Zhang

This is called after a path context object is created to pass it back to QuicConnectionMigrationManager. This might be a function to kick off path validation or immediate migration depending on where it is called.

Dan Zhang

Changed this to me virtual interface

Open in Gerrit

Related details

Attention is currently required from:
  • Ali Beyad
  • Dan Zhang
  • Ryan Hamilton
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I59f663699a63754a7cf04bd7002d740cd60a306f
Gerrit-Change-Number: 5980615
Gerrit-PatchSet: 17
Gerrit-Owner: Dan Zhang <da...@chromium.org>
Gerrit-CC: Ali Beyad <abe...@google.com>
Gerrit-CC: Dan Zhang <da...@google.com>
Gerrit-CC: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Ali Beyad <abe...@google.com>
Gerrit-Attention: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Dan Zhang <da...@chromium.org>
Gerrit-Comment-Date: Thu, 12 Dec 2024 15:13:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ali Beyad <abe...@google.com>
Comment-In-Reply-To: Ryan Hamilton <r...@chromium.org>
Comment-In-Reply-To: Dan Zhang <da...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Dan Zhang (Gerrit)

unread,
Dec 12, 2024, 10:16:10 AM12/12/24
to Dan Zhang, Ali Beyad, Ryan Hamilton, Tricium, chromium...@chromium.org, net-r...@chromium.org
Attention needed from Ali Beyad, Dan Zhang and Ryan Hamilton

Dan Zhang added 1 comment

File net/quic/quic_chromium_client_session.h
Line 529, Patchset 10: bool migrate_sessions_on_network_change_v2,
Ali Beyad . resolved

nit: this CL already has a lot going on, so we should probably save other improvements like this one (thanks for spotting and fixing this btw!) into a separate CL.

Dan Zhang

I got complain about existing typo otherwise, maybe because I touched the related code.

Gerrit-Comment-Date: Thu, 12 Dec 2024 15:16:01 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Ryan Hamilton (Gerrit)

unread,
Dec 16, 2024, 10:32:25 AM12/16/24
to Dan Zhang, Ali Beyad, Ryan Hamilton, Tricium, chromium...@chromium.org, Dan Zhang, net-r...@chromium.org
Attention needed from Ali Beyad and Dan Zhang

Ryan Hamilton added 1 comment

File net/quic/quic_force_blockable_packet_writer.h
Line 19, Patchset 14: virtual void ForceWriteBlockage(bool write_blocked) = 0;
Ryan Hamilton . unresolved

nit: "Blockage" => "Blocked", I think.

Dan Zhang

The bool argument, when false, will undo any previous force blocking. Naming it ForceWriteBlocked() is misleading. Admittedly the current name sounds weird too...

Dan Zhang

Any thoughts on this?

Ryan Hamilton

Hm. I'm not sure that `ForceWriteBlocked(false)` sounds any more or less misleading than `ForWriteBlockage(false)`. To my ear they're pretty similar, the only difference being that "Blocked" is parallel to "IsWriteBocked" whereas "Blockage" is similar but different.

Open in Gerrit

Related details

Attention is currently required from:
  • Ali Beyad
  • Dan Zhang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I59f663699a63754a7cf04bd7002d740cd60a306f
Gerrit-Change-Number: 5980615
Gerrit-PatchSet: 17
Gerrit-Owner: Dan Zhang <da...@chromium.org>
Gerrit-CC: Ali Beyad <abe...@google.com>
Gerrit-CC: Dan Zhang <da...@google.com>
Gerrit-CC: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Ali Beyad <abe...@google.com>
Gerrit-Attention: Dan Zhang <da...@chromium.org>
Gerrit-Comment-Date: Mon, 16 Dec 2024 15:32:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Dan Zhang (Gerrit)

unread,
Dec 16, 2024, 10:58:53 PM12/16/24
to Dan Zhang, Ali Beyad, Ryan Hamilton, Tricium, chromium...@chromium.org, net-r...@chromium.org
Attention needed from Ali Beyad and Dan Zhang

Dan Zhang added 1 comment

File net/quic/quic_force_blockable_packet_writer.h
Line 19, Patchset 14: virtual void ForceWriteBlockage(bool write_blocked) = 0;
Ryan Hamilton . unresolved

nit: "Blockage" => "Blocked", I think.

Dan Zhang

The bool argument, when false, will undo any previous force blocking. Naming it ForceWriteBlocked() is misleading. Admittedly the current name sounds weird too...

Dan Zhang

Any thoughts on this?

Ryan Hamilton

Hm. I'm not sure that `ForceWriteBlocked(false)` sounds any more or less misleading than `ForWriteBlockage(false)`. To my ear they're pretty similar, the only difference being that "Blocked" is parallel to "IsWriteBocked" whereas "Blockage" is similar but different.

Dan Zhang

Okay, renamed the method and its argument to be less ambigious.

Open in Gerrit

Related details

Attention is currently required from:
  • Ali Beyad
  • Dan Zhang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I59f663699a63754a7cf04bd7002d740cd60a306f
Gerrit-Change-Number: 5980615
Gerrit-PatchSet: 18
Gerrit-Owner: Dan Zhang <da...@chromium.org>
Gerrit-CC: Ali Beyad <abe...@google.com>
Gerrit-CC: Dan Zhang <da...@google.com>
Gerrit-CC: Ryan Hamilton <r...@chromium.org>
Gerrit-Attention: Ali Beyad <abe...@google.com>
Gerrit-Attention: Dan Zhang <da...@chromium.org>
Gerrit-Comment-Date: Tue, 17 Dec 2024 03:58:45 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages