diff options
author | Songchun Fan <schfan@google.com> | 2021-04-14 19:04:11 +0000 |
---|---|---|
committer | Songchun Fan <schfan@google.com> | 2021-04-16 02:29:24 +0000 |
commit | 5ada1508c2e8cf005258e04117bf38fee759f31e (patch) | |
tree | 70b916edb279b878216359a2d1544419c47e8a7b /services/incremental/IncrementalService.cpp | |
parent | e53db0d40254f57d8af33e0dcac43e464a06bd31 (diff) |
[pm] remove incremental startable/unstartable code
Also remove streaming health status reporting which could cause
startable state change because it is also not needed any more.
BUG: 171920377
Test: builds
Change-Id: I7284e7a63df79da7dbf3d16ff64302b3d1ce1348
Diffstat (limited to 'services/incremental/IncrementalService.cpp')
-rw-r--r-- | services/incremental/IncrementalService.cpp | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/services/incremental/IncrementalService.cpp b/services/incremental/IncrementalService.cpp index 11a700c8ef9f..4ce336d16f15 100644 --- a/services/incremental/IncrementalService.cpp +++ b/services/incremental/IncrementalService.cpp @@ -2189,29 +2189,6 @@ bool IncrementalService::unregisterLoadingProgressListener(StorageId storage) { return removeTimedJobs(*mProgressUpdateJobQueue, storage); } -bool IncrementalService::registerStorageHealthListener( - StorageId storage, const StorageHealthCheckParams& healthCheckParams, - StorageHealthListener healthListener) { - DataLoaderStubPtr dataLoaderStub; - { - const auto& ifs = getIfs(storage); - if (!ifs) { - return false; - } - std::unique_lock l(ifs->lock); - dataLoaderStub = ifs->dataLoaderStub; - if (!dataLoaderStub) { - return false; - } - } - dataLoaderStub->setHealthListener(healthCheckParams, std::move(healthListener)); - return true; -} - -void IncrementalService::unregisterStorageHealthListener(StorageId storage) { - registerStorageHealthListener(storage, {}, {}); -} - bool IncrementalService::perfLoggingEnabled() { static const bool enabled = base::GetBoolProperty("incremental.perflogging", false); return enabled; @@ -2779,25 +2756,6 @@ void IncrementalService::DataLoaderStub::setCurrentStatus(int newStatus) { mStatusCondition.notify_all(); } -binder::Status IncrementalService::DataLoaderStub::reportStreamHealth(MountId mountId, - int newStatus) { - if (!isValid()) { - return binder::Status:: - fromServiceSpecificError(-EINVAL, - "reportStreamHealth came to invalid DataLoaderStub"); - } - if (id() != mountId) { - LOG(ERROR) << "reportStreamHealth: mount ID mismatch: expected " << id() - << ", but got: " << mountId; - return binder::Status::fromServiceSpecificError(-EPERM, "Mount ID mismatch."); - } - { - std::lock_guard lock(mMutex); - mStreamStatus = newStatus; - } - return binder::Status::ok(); -} - bool IncrementalService::DataLoaderStub::isHealthParamsValid() const { return mHealthCheckParams.blockedTimeoutMs > 0 && mHealthCheckParams.blockedTimeoutMs < mHealthCheckParams.unhealthyTimeoutMs; @@ -2811,33 +2769,6 @@ void IncrementalService::DataLoaderStub::onHealthStatus(const StorageHealthListe } } -static int adjustHealthStatus(int healthStatus, int streamStatus) { - if (healthStatus == IStorageHealthListener::HEALTH_STATUS_OK) { - // everything is good; no need to change status - return healthStatus; - } - int newHeathStatus = healthStatus; - switch (streamStatus) { - case IDataLoaderStatusListener::STREAM_STORAGE_ERROR: - // storage is limited and storage not healthy - newHeathStatus = IStorageHealthListener::HEALTH_STATUS_UNHEALTHY_STORAGE; - break; - case IDataLoaderStatusListener::STREAM_INTEGRITY_ERROR: - // fall through - case IDataLoaderStatusListener::STREAM_SOURCE_ERROR: - // fall through - case IDataLoaderStatusListener::STREAM_TRANSPORT_ERROR: - if (healthStatus == IStorageHealthListener::HEALTH_STATUS_UNHEALTHY) { - newHeathStatus = IStorageHealthListener::HEALTH_STATUS_UNHEALTHY_TRANSPORT; - } - // pending/blocked status due to transportation issues is not regarded as unhealthy - break; - default: - break; - } - return newHeathStatus; -} - void IncrementalService::DataLoaderStub::updateHealthStatus(bool baseline) { LOG(DEBUG) << id() << ": updateHealthStatus" << (baseline ? " (baseline)" : ""); @@ -2915,8 +2846,6 @@ void IncrementalService::DataLoaderStub::updateHealthStatus(bool baseline) { checkBackAfter = unhealthyMonitoring; healthStatusToReport = IStorageHealthListener::HEALTH_STATUS_UNHEALTHY; } - // Adjust health status based on stream status - healthStatusToReport = adjustHealthStatus(healthStatusToReport, mStreamStatus); LOG(DEBUG) << id() << ": updateHealthStatus in " << double(checkBackAfter.count()) / 1000.0 << "secs"; mService.addTimedJob(*mService.mTimedQueue, id(), checkBackAfter, |