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

Issue 9251035: Delete lots of sync ServerConnectionManager code (Closed)

Created:
8 years, 11 months ago by rlarocque
Modified:
8 years, 9 months ago
CC:
chromium-reviews, ncarter (slow), akalin, Raghu Simha, kkania, cbentzel+watch_chromium.org, robertshield, darin-cc_chromium.org, tim (not reviewing)
Visibility:
Public.

Description

Delete lots of sync ServerConnectionManager code This removes several pieces of internal state and functions from the ServerConnectionManager and related classes, including: * SyncManager::Summary.authenticated: This variable name was very misleading. AllStatus managed it by setting it to true iff the last attempt to hit the sync server resulting in a 200 OK response. This is especially misleading since CheckServerReachable()/CheckTime() do not validate the server's credentials in any way. * AllStatus::HandleAuthWatcherEvent(): This function was not defined. It should have been removed from the header file ages ago. * AllStatus::CalcStatusChanges()'s 'online' flag: This was based on unreliable flags such as server_reachable, server_up and server_broken. It is now ard-coded to 'true'. This makes the "offline" states (OFFLINE, OFFLINE_UNUSABLE, etc.) unreachable. * ServerConnectionManager's server_up and server_reachable: No important decisions were made based on the status of these variables. The way in which they were maintained was questionable as well. The server_reachable flag, in particular, had an effect on our ability to retry on connection failures that seems almost arbitrary. We would retry to connect *once* after an IP address change, then never again until the IP adddress change again. However, if that first ping did succeed, server_reachable would remain set (and we would continue retrying to contact the server with exponential backoff) indefinitely. Also removed in this chage are SyncManager::Summary's server_up and server_reachable, as well as most of the code that depends on them. * ServerConnectionManager::CheckServerReachable(): The only effect these functions could have would be to alter the value of server_reachable and the server_status. Neither of these variables have been put to good use, so we should be able to remove this code without ill effect. * ServerConnectionManager::CheckTime(): There are some comments in this function claiming it protects against WiFi redirects. This may have been true at some point, but these days we use HTTPS. If a router can mangle server responses, we have bigger problems than sync not working. * ServerConnectionManager::IsUserAuthenticated(): I believe this is not used anywhere. * ServerConnectoinManager::SetServerParameters(): Also not used. * SyncScheduler's ServerConnectionManager observing functionality has been removed. All 'pings' that arrived through this function were either a direct result of SyncScheduler activity (ie. the scheduler tried to run a sync cycle and it failed or succeeded unexpectedly), a change in user credentials, during startup, or during an IP address change. It is much simpler to have the events that should cause the SyncScheduler run a canary job notify the scheduler directly, rather than threading it (incorrectly) through the ServerConnectionManager. Doing it this way also removes the need for pinging the server to check the time, which isn't really necessary anway. The one big behavioural change in this patch is that we *never* give up in trying to contact the server. There is no longer a server_reachable variable and we act as tough it were always true. This isn't too much different from the old behaviour, where server_reachable would get set once and almost never get unset. It does mean that we won't give up so easily in contacting the server when we start offline, though. BUG=98346 TEST=Tests involving enabling and disabling network access would be especially valuable here.

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -314 lines) Patch
M chrome/browser/automation/testing_automation_provider.cc View 2 chunks +1 line, -3 lines 0 comments Download
M chrome/browser/sync/engine/all_status.h View 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/sync/engine/all_status.cc View 2 chunks +6 lines, -15 lines 0 comments Download
M chrome/browser/sync/engine/net/server_connection_manager.h View 3 chunks +4 lines, -22 lines 0 comments Download
M chrome/browser/sync/engine/net/server_connection_manager.cc View 1 chunk +0 lines, -74 lines 0 comments Download
M chrome/browser/sync/engine/sync_scheduler.h View 3 chunks +14 lines, -9 lines 0 comments Download
M chrome/browser/sync/engine/sync_scheduler.cc View 7 chunks +6 lines, -54 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.cc View 3 chunks +0 lines, -15 lines 0 comments Download
M chrome/browser/sync/internal_api/sync_manager.h View 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/sync/internal_api/sync_manager.cc View 8 chunks +10 lines, -30 lines 0 comments Download
M chrome/browser/sync/internal_api/syncapi_server_connection_manager_unittest.cc View 2 chunks +0 lines, -27 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_harness.cc View 5 chunks +0 lines, -33 lines 0 comments Download
M chrome/browser/sync/sync_ui_util.cc View 3 chunks +0 lines, -13 lines 1 comment Download
M chrome/browser/sync/test/engine/mock_connection_manager.h View 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/sync/test/engine/mock_connection_manager.cc View 1 chunk +0 lines, -8 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
rlarocque
This post is FYI only; I'm not looking to commit it yet. This is in ...
8 years, 11 months ago (2012-01-19 02:17:28 UTC) #1
rlarocque
http://codereview.chromium.org/9251035/diff/1/chrome/browser/sync/sync_ui_util.cc File chrome/browser/sync/sync_ui_util.cc (left): http://codereview.chromium.org/9251035/diff/1/chrome/browser/sync/sync_ui_util.cc#oldcode294 chrome/browser/sync/sync_ui_util.cc:294: } else if (!status.authenticated) { Since status.authenticated correlates mostly ...
8 years, 11 months ago (2012-01-19 02:23:05 UTC) #2
tim (not reviewing)
8 years, 11 months ago (2012-01-19 23:13:52 UTC) #3
RE: * SyncManager::Summary.authenticated: This variable name was very
misleading.
AllStatus managed it by setting it to true iff the last attempt to hit the
sync server resulting in a 200 OK response. This is especially misleading
since CheckServerReachable()/CheckTime() do not validate the server's
credentials in any way.


Now that we have the last response code for individual request types, can't we
do this properly?

Powered by Google App Engine
This is Rietveld 408576698