New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 737273 link

Starred by 0 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

Restore tether network state after crash

Project Member Reported by khorimoto@chromium.org, Jun 27 2017

Issue description

1. Connect to a Tether network.
2. Crash the browser. For testing purposes, you can navigate to chrome://inducebrowsercrashforrealz to induce a crash.

Expected:
System will still know that you're connected to a Tether network.

Actual:
System will still be connected to the underlying Wi-Fi network, but it won't have any knowledge of the Tether network.

This issue occurs because the Tether info is stored in memory as part of NetworkStateHandler but the underlying networking code is part of a separate process (Shill). After a crash, we should detect that we already have an active host and restore the state accordingly.
 
Status: Started (was: Assigned)
Labels: -Pri-3 M-61 Pri-1
Project Member

Comment 3 by bugdroid1@chromium.org, Jul 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a451dfec089978bf3b2d508000d58e80b2b0af68

commit a451dfec089978bf3b2d508000d58e80b2b0af68
Author: Kyle Horimoto <khorimoto@google.com>
Date: Wed Jul 12 21:46:26 2017

[CrOS Tether] Convert HostScanCache to an interface and add MasterHostScanCache as the concrete implementation.

This CL also creates a HostScanCacheEntry class which encapsulates data to be stored in the cache as well as adding a Builder pattern which makes creating cache entries easier. This will make it much easier to add new properties to the host scan cache without having to add new     parameters to every affected function prototype.

This is the first step of persisting host scan results so that we can recover from crashes. Steps listed below:
(1 - this CL) Create a HostScanCache interface and move the concrete implementation to MasterHostScanCache.
(2) Create a HostScanCache implementation which persists cache entries to user prefs.
(3) Move code which adds entries in the network stack to another HostScanCache implementation, and have MasterHostScanCache manage the other two HostScanCache implementations.

Bug: 672263,  737273 
Change-Id: I42646de50d393e9b327371effbf974020083b12d
Reviewed-on: https://chromium-review.googlesource.com/567235
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Reviewed-by: Ryan Hansberry <hansberry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486097}
[modify] https://crrev.com/a451dfec089978bf3b2d508000d58e80b2b0af68/chromeos/components/tether/BUILD.gn
[modify] https://crrev.com/a451dfec089978bf3b2d508000d58e80b2b0af68/chromeos/components/tether/fake_host_scan_cache.cc
[modify] https://crrev.com/a451dfec089978bf3b2d508000d58e80b2b0af68/chromeos/components/tether/fake_host_scan_cache.h
[modify] https://crrev.com/a451dfec089978bf3b2d508000d58e80b2b0af68/chromeos/components/tether/host_scan_cache.h
[add] https://crrev.com/a451dfec089978bf3b2d508000d58e80b2b0af68/chromeos/components/tether/host_scan_cache_entry.cc
[add] https://crrev.com/a451dfec089978bf3b2d508000d58e80b2b0af68/chromeos/components/tether/host_scan_cache_entry.h
[modify] https://crrev.com/a451dfec089978bf3b2d508000d58e80b2b0af68/chromeos/components/tether/host_scanner.cc
[modify] https://crrev.com/a451dfec089978bf3b2d508000d58e80b2b0af68/chromeos/components/tether/host_scanner_unittest.cc
[modify] https://crrev.com/a451dfec089978bf3b2d508000d58e80b2b0af68/chromeos/components/tether/initializer.cc
[modify] https://crrev.com/a451dfec089978bf3b2d508000d58e80b2b0af68/chromeos/components/tether/keep_alive_scheduler.cc
[modify] https://crrev.com/a451dfec089978bf3b2d508000d58e80b2b0af68/chromeos/components/tether/keep_alive_scheduler_unittest.cc
[rename] https://crrev.com/a451dfec089978bf3b2d508000d58e80b2b0af68/chromeos/components/tether/master_host_scan_cache.cc
[add] https://crrev.com/a451dfec089978bf3b2d508000d58e80b2b0af68/chromeos/components/tether/master_host_scan_cache.h
[rename] https://crrev.com/a451dfec089978bf3b2d508000d58e80b2b0af68/chromeos/components/tether/master_host_scan_cache_unittest.cc
[modify] https://crrev.com/a451dfec089978bf3b2d508000d58e80b2b0af68/chromeos/components/tether/tether_connector_unittest.cc
[modify] https://crrev.com/a451dfec089978bf3b2d508000d58e80b2b0af68/chromeos/components/tether/tether_host_response_recorder.h

Project Member

Comment 4 by bugdroid1@chromium.org, Jul 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/37dd3d78e2e3da45b6a5a0acf3eacb6759b97fa3

commit 37dd3d78e2e3da45b6a5a0acf3eacb6759b97fa3
Author: Kyle Horimoto <khorimoto@google.com>
Date: Fri Jul 14 01:00:29 2017

[CrOS Tether] Create PersistentHostScanCache, which persists host scan results to user prefs so that they can be accessed after the in-memory cache object has been deleted.

This is the first step of persisting host scan results so that we can recover from crashes. Steps listed below:
(1) Create a HostScanCache interface and move the concrete implementation to MasterHostScanCache.
(2 - this CL) Create a HostScanCache implementation which persists cache entries to user prefs.
(3) Move code which adds entries in the network stack to another HostScanCache implementation, and have MasterHostScanCache manage the other two HostScanCache implementations.

Bug: 672263,  737273 
Change-Id: If4bd22df02e0c2eea577a738c16c0657465e4bde
Reviewed-on: https://chromium-review.googlesource.com/568172
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Reviewed-by: Ryan Hansberry <hansberry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486566}
[modify] https://crrev.com/37dd3d78e2e3da45b6a5a0acf3eacb6759b97fa3/chromeos/components/tether/BUILD.gn
[modify] https://crrev.com/37dd3d78e2e3da45b6a5a0acf3eacb6759b97fa3/chromeos/components/tether/host_scan_cache_entry.cc
[modify] https://crrev.com/37dd3d78e2e3da45b6a5a0acf3eacb6759b97fa3/chromeos/components/tether/host_scan_cache_entry.h
[add] https://crrev.com/37dd3d78e2e3da45b6a5a0acf3eacb6759b97fa3/chromeos/components/tether/host_scan_test_util.cc
[add] https://crrev.com/37dd3d78e2e3da45b6a5a0acf3eacb6759b97fa3/chromeos/components/tether/host_scan_test_util.h
[modify] https://crrev.com/37dd3d78e2e3da45b6a5a0acf3eacb6759b97fa3/chromeos/components/tether/initializer.cc
[modify] https://crrev.com/37dd3d78e2e3da45b6a5a0acf3eacb6759b97fa3/chromeos/components/tether/master_host_scan_cache_unittest.cc
[add] https://crrev.com/37dd3d78e2e3da45b6a5a0acf3eacb6759b97fa3/chromeos/components/tether/persistent_host_scan_cache.cc
[add] https://crrev.com/37dd3d78e2e3da45b6a5a0acf3eacb6759b97fa3/chromeos/components/tether/persistent_host_scan_cache.h
[add] https://crrev.com/37dd3d78e2e3da45b6a5a0acf3eacb6759b97fa3/chromeos/components/tether/persistent_host_scan_cache_unittest.cc
[modify] https://crrev.com/37dd3d78e2e3da45b6a5a0acf3eacb6759b97fa3/chromeos/components/tether/pref_names.cc
[modify] https://crrev.com/37dd3d78e2e3da45b6a5a0acf3eacb6759b97fa3/chromeos/components/tether/pref_names.h

Project Member

Comment 5 by bugdroid1@chromium.org, Jul 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d0071027ca8348fe8564c8dd07351f8d57d93a01

commit d0071027ca8348fe8564c8dd07351f8d57d93a01
Author: Kyle Horimoto <khorimoto@google.com>
Date: Mon Jul 17 19:33:00 2017

[CrOS Tether] Separate network stack code from MasterHostScanCache and convert MasterHostScanCache into a manager of both the networking and persistent caches.

This is the third step of persisting host scan results so that we can recover from crashes. Steps listed below:
(1) Create a HostScanCache interface and move the concrete implementation to MasterHostScanCache.
(2) Create a HostScanCache implementation which persists cache entries to user prefs.
(3 - this CL) Move code which adds entries in the network stack to another HostScanCache implementation, and have MasterHostScanCache manage the other two HostScanCache implementations.

After this CL, host scan results will be restored after a crash, but the active host will not yet be restored. That will occur in a follow-up CL.

Bug: 672263,  737273 
Change-Id: I594ad829c5c5b010accc6089f9575aef9afb0cae
Reviewed-on: https://chromium-review.googlesource.com/570925
Reviewed-by: Ryan Hansberry <hansberry@chromium.org>
Commit-Queue: Ryan Hansberry <hansberry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487192}
[modify] https://crrev.com/d0071027ca8348fe8564c8dd07351f8d57d93a01/chromeos/components/tether/BUILD.gn
[modify] https://crrev.com/d0071027ca8348fe8564c8dd07351f8d57d93a01/chromeos/components/tether/fake_host_scan_cache.cc
[modify] https://crrev.com/d0071027ca8348fe8564c8dd07351f8d57d93a01/chromeos/components/tether/fake_host_scan_cache.h
[modify] https://crrev.com/d0071027ca8348fe8564c8dd07351f8d57d93a01/chromeos/components/tether/host_scan_cache.h
[modify] https://crrev.com/d0071027ca8348fe8564c8dd07351f8d57d93a01/chromeos/components/tether/initializer.cc
[modify] https://crrev.com/d0071027ca8348fe8564c8dd07351f8d57d93a01/chromeos/components/tether/initializer.h
[modify] https://crrev.com/d0071027ca8348fe8564c8dd07351f8d57d93a01/chromeos/components/tether/master_host_scan_cache.cc
[modify] https://crrev.com/d0071027ca8348fe8564c8dd07351f8d57d93a01/chromeos/components/tether/master_host_scan_cache.h
[modify] https://crrev.com/d0071027ca8348fe8564c8dd07351f8d57d93a01/chromeos/components/tether/master_host_scan_cache_unittest.cc
[add] https://crrev.com/d0071027ca8348fe8564c8dd07351f8d57d93a01/chromeos/components/tether/network_host_scan_cache.cc
[add] https://crrev.com/d0071027ca8348fe8564c8dd07351f8d57d93a01/chromeos/components/tether/network_host_scan_cache.h
[add] https://crrev.com/d0071027ca8348fe8564c8dd07351f8d57d93a01/chromeos/components/tether/network_host_scan_cache_unittest.cc
[modify] https://crrev.com/d0071027ca8348fe8564c8dd07351f8d57d93a01/chromeos/components/tether/persistent_host_scan_cache.h
[rename] https://crrev.com/d0071027ca8348fe8564c8dd07351f8d57d93a01/chromeos/components/tether/persistent_host_scan_cache_impl.cc
[add] https://crrev.com/d0071027ca8348fe8564c8dd07351f8d57d93a01/chromeos/components/tether/persistent_host_scan_cache_impl.h
[rename] https://crrev.com/d0071027ca8348fe8564c8dd07351f8d57d93a01/chromeos/components/tether/persistent_host_scan_cache_impl_unittest.cc
[modify] https://crrev.com/d0071027ca8348fe8564c8dd07351f8d57d93a01/chromeos/components/tether/tether_host_response_recorder.h

Project Member

Comment 6 by bugdroid1@chromium.org, Jul 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5cc569776d1068166b98e5736619552858cc7e7e

commit 5cc569776d1068166b98e5736619552858cc7e7e
Author: Kyle Horimoto <khorimoto@google.com>
Date: Mon Jul 17 22:39:12 2017

[CrOS Tether] Create CrashRecoveryManager, which restores Tether state after a crash.

Previously, if a Tether connection was active and the browser crashed, the UI would start back up and show the device connected to the raw Wi-Fi network instead of the special Tether network; furthermore, all host scan results were gone and the device would not continue to send KeepAliveTickle messages to the active host, resulting in the phone's hotspot shutting down automatically.

This CL creates a class which is run at the end of initialization of the Tether module, before a host scan begins. If it detects that there was saved active host data in persistent storage, it knows that the last session ended due to a crash since persistent active host data is cleared under the normal shutdown flow. If this is the case, CrashRecoveryManager restores the connection.

Bug: 672263,  737273 
Change-Id: Id51967e20855edb086285f5bfdb92c4677bee77c
Reviewed-on: https://chromium-review.googlesource.com/572840
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Reviewed-by: Ryan Hansberry <hansberry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487282}
[modify] https://crrev.com/5cc569776d1068166b98e5736619552858cc7e7e/chromeos/components/tether/BUILD.gn
[modify] https://crrev.com/5cc569776d1068166b98e5736619552858cc7e7e/chromeos/components/tether/active_host.h
[add] https://crrev.com/5cc569776d1068166b98e5736619552858cc7e7e/chromeos/components/tether/crash_recovery_manager.cc
[add] https://crrev.com/5cc569776d1068166b98e5736619552858cc7e7e/chromeos/components/tether/crash_recovery_manager.h
[add] https://crrev.com/5cc569776d1068166b98e5736619552858cc7e7e/chromeos/components/tether/crash_recovery_manager_unittest.cc
[modify] https://crrev.com/5cc569776d1068166b98e5736619552858cc7e7e/chromeos/components/tether/initializer.cc
[modify] https://crrev.com/5cc569776d1068166b98e5736619552858cc7e7e/chromeos/components/tether/initializer.h

Status: Fixed (was: Started)

Sign in to add a comment