From cb59156be3aba1fb54f9d0a7df179f5ae55bf69a Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Mon, 6 Mar 2023 15:53:44 +0000 Subject: servicemanager: -= clients log spam This log was inverted when the patch was relanded. It should almost never happen, but was causing ~300 lines of logspam. Bug: 210919187 Test: boot Change-Id: Ic5fd6db2fe85b0aceb41a31d49520839a250edb8 --- cmds/servicemanager/ServiceManager.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmds/servicemanager/ServiceManager.cpp b/cmds/servicemanager/ServiceManager.cpp index eadf67821f..bec262e25a 100644 --- a/cmds/servicemanager/ServiceManager.cpp +++ b/cmds/servicemanager/ServiceManager.cpp @@ -223,8 +223,13 @@ static bool meetsDeclarationRequirements(const sp& binder, const std::s #endif // !VENDORSERVICEMANAGER ServiceManager::Service::~Service() { - if (!hasClients) { - // only expected to happen on process death + if (hasClients) { + // only expected to happen on process death, we don't store the service + // name this late (it's in the map that holds this service), but if it + // is happening, we might want to change 'unlinkToDeath' to explicitly + // clear this bit so that we can abort in other cases, where it would + // mean inconsistent logic in servicemanager (unexpected and tested, but + // the original lazy service impl here had that bug). LOG(WARNING) << "a service was removed when there are clients"; } } -- cgit v1.2.3-59-g8ed1b