Commit bc770788 authored by Yuwei Huang's avatar Yuwei Huang Committed by Commit Bot

[remoting host] Always sign out FTL when signaling disconnected

Previously we tried to reuse the FTL auth token for multiple connection
attempts, and it will only reset if FTL returns an UNAUTHENTICATED
error. This doesn't seem to work since we learnt from the last FTL
outage that FTL servers can return NOT_FOUND for registration that has
been deleted. So it's safer to just re-sign-in every time the signal
strategy is disconnected, which doesn't take too much time.

(Note that stream lifetime exceeded and pong timeout are handled inside
FTLMessageReceptionChannel, which isn't affected by this change.)

Bug: 992722
Change-Id: Iee10f04e4ddeea71317b7859a943098d0f0c38fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2088633Reviewed-by: default avatarJoe Downing <joedow@chromium.org>
Commit-Queue: Yuwei Huang <yuweih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747375}
parent dbf57b87
...@@ -152,6 +152,10 @@ void FtlSignalStrategy::Core::Connect() { ...@@ -152,6 +152,10 @@ void FtlSignalStrategy::Core::Connect() {
void FtlSignalStrategy::Core::Disconnect() { void FtlSignalStrategy::Core::Disconnect() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (registration_manager_->IsSignedIn()) {
registration_manager_->SignOut();
}
if (receive_message_subscription_) { if (receive_message_subscription_) {
local_address_ = SignalingAddress(); local_address_ = SignalingAddress();
receive_message_subscription_.reset(); receive_message_subscription_.reset();
...@@ -395,7 +399,6 @@ void FtlSignalStrategy::Core::HandleGrpcStatusError( ...@@ -395,7 +399,6 @@ void FtlSignalStrategy::Core::HandleGrpcStatusError(
<< ", message: " << status.error_message() << ", message: " << status.error_message()
<< ", location: " << location.ToString(); << ", location: " << location.ToString();
if (status.error_code() == grpc::StatusCode::UNAUTHENTICATED) { if (status.error_code() == grpc::StatusCode::UNAUTHENTICATED) {
registration_manager_->SignOut();
oauth_token_getter_->InvalidateCache(); oauth_token_getter_->InvalidateCache();
} }
Disconnect(); Disconnect();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment