Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(889)

Unified Diff: sync/engine/net/server_connection_manager.cc

Issue 62423002: Fix one case that can make sync backend stuck in auth error state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sync/engine/net/server_connection_manager.cc
diff --git a/sync/engine/net/server_connection_manager.cc b/sync/engine/net/server_connection_manager.cc
index 4927acdaa75630bca9ed3fbee6c25060aa1553f5..a6ee157690d3a1dda92fa10de94352a29140159d 100644
--- a/sync/engine/net/server_connection_manager.cc
+++ b/sync/engine/net/server_connection_manager.cc
@@ -233,6 +233,12 @@ bool ServerConnectionManager::SetAuthToken(const std::string& auth_token) {
previously_invalidated_token = std::string();
return true;
}
+
+ // This could happen in case like server outage/bug. Need to notify sync
tim (not reviewing) 2013/11/06 19:35:32 What is server outage/bug? Either explain the out
haitaol1 2013/11/06 22:37:30 Done.
+ // frontend again to request new token, otherwise backend will stay in
+ // SYNC_AUTH_ERROR state while fronend thinks everything is fine and takes
+ // no actions.
+ SetServerStatus(HttpResponse::SYNC_AUTH_ERROR);
tim (not reviewing) 2013/11/06 19:35:32 I guess the only case that is implicitly in the "e
haitaol1 2013/11/06 22:37:30 Empty token shouldn't be possible because ProfileS
return false;
}
@@ -252,8 +258,12 @@ void ServerConnectionManager::InvalidateAndClearAuthToken() {
void ServerConnectionManager::SetServerStatus(
HttpResponse::ServerConnectionCode server_status) {
- if (server_status_ == server_status)
+ // SYNC_AUTH_ERROR is permanent error. Need to notify observer to take
+ // action externally to resolve.
+ if (server_status != HttpResponse::SYNC_AUTH_ERROR &&
+ server_status_ == server_status) {
tim (not reviewing) 2013/11/06 19:35:32 Pavel and Richard should review this part carefull
haitaol1 2013/11/06 22:37:30 acked
haitaol1 2013/11/07 15:23:52 Another option is to leverage CONNECTION_NOT_ATTEM
return;
+ }
server_status_ = server_status;
NotifyStatusChanged();
}
« chrome/browser/sync/profile_sync_service.cc ('K') | « chrome/browser/sync/profile_sync_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698