From dd247c654c112eb24b25dfb093dc9af46fa3ff5c Mon Sep 17 00:00:00 2001 From: yangliu Date: Wed, 11 Jun 2025 11:51:26 +0800 Subject: [PATCH 1/4] update Signed-off-by: yangliu --- .../app/src/kvstore_data_service.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/services/distributeddataservice/app/src/kvstore_data_service.cpp b/services/distributeddataservice/app/src/kvstore_data_service.cpp index b598a653a..56f3f09a8 100644 --- a/services/distributeddataservice/app/src/kvstore_data_service.cpp +++ b/services/distributeddataservice/app/src/kvstore_data_service.cpp @@ -271,7 +271,7 @@ int32_t KvStoreDataService::Exit(const std::string &featureName) } Status KvStoreDataService::AppExit(pid_t uid, pid_t pid, uint32_t token, const AppId &appId) { - ZLOGI("AppExit"); + ZLOGD("AppExit"); // memory of parameter appId locates in a member of clientDeathObserverMap_ and will be freed after // clientDeathObserverMap_ erase, so we have to take a copy if we want to use this parameter after erase operation. AppId appIdTmp = appId; @@ -780,7 +780,7 @@ KvStoreDataService::KvStoreClientDeathObserverImpl::KvStoreClientDeathObserverIm pid_ = IPCSkeleton::GetCallingPid(); token_ = IPCSkeleton::GetCallingTokenID(); if (observer != nullptr) { - ZLOGI("add death recipient"); + ZLOGD("add death recipient"); observer->AddDeathRecipient(deathRecipient_); observerProxy_.insert_or_assign(featureName, std::move(observer)); } else { @@ -814,9 +814,9 @@ KvStoreDataService::KvStoreClientDeathObserverImpl &KvStoreDataService::KvStoreC KvStoreDataService::KvStoreClientDeathObserverImpl::~KvStoreClientDeathObserverImpl() { - ZLOGI("~KvStoreClientDeathObserverImpl"); + ZLOGD("~KvStoreClientDeathObserverImpl"); if (deathRecipient_ != nullptr && !observerProxy_.empty()) { - ZLOGI("remove death recipient"); + ZLOGD("remove death recipient"); for (auto &[key, value] : observerProxy_) { if (value != nullptr) { value->RemoveDeathRecipient(deathRecipient_); @@ -885,7 +885,7 @@ KvStoreDataService::KvStoreClientDeathObserverImpl::KvStoreDeathRecipient::KvSto KvStoreClientDeathObserverImpl &kvStoreClientDeathObserverImpl) : kvStoreClientDeathObserverImpl_(kvStoreClientDeathObserverImpl) { - ZLOGI("KvStore Client Death Observer"); + ZLOGD("KvStore Client Death Observer"); } KvStoreDataService::KvStoreClientDeathObserverImpl::KvStoreDeathRecipient::~KvStoreDeathRecipient() @@ -897,7 +897,7 @@ void KvStoreDataService::KvStoreClientDeathObserverImpl::KvStoreDeathRecipient:: const wptr &remote) { (void) remote; - ZLOGI("begin"); + ZLOGD("begin"); if (!clientDead_.exchange(true)) { kvStoreClientDeathObserverImpl_.NotifyClientDie(); } -- Gitee From 38b18017f18459c541075e0cadab760c989d10de Mon Sep 17 00:00:00 2001 From: yangliu Date: Thu, 12 Jun 2025 17:36:20 +0800 Subject: [PATCH 2/4] update Signed-off-by: yangliu --- .../distributeddataservice/app/src/kvstore_data_service.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/services/distributeddataservice/app/src/kvstore_data_service.cpp b/services/distributeddataservice/app/src/kvstore_data_service.cpp index 56f3f09a8..457c7c6f3 100644 --- a/services/distributeddataservice/app/src/kvstore_data_service.cpp +++ b/services/distributeddataservice/app/src/kvstore_data_service.cpp @@ -814,9 +814,7 @@ KvStoreDataService::KvStoreClientDeathObserverImpl &KvStoreDataService::KvStoreC KvStoreDataService::KvStoreClientDeathObserverImpl::~KvStoreClientDeathObserverImpl() { - ZLOGD("~KvStoreClientDeathObserverImpl"); if (deathRecipient_ != nullptr && !observerProxy_.empty()) { - ZLOGD("remove death recipient"); for (auto &[key, value] : observerProxy_) { if (value != nullptr) { value->RemoveDeathRecipient(deathRecipient_); @@ -824,6 +822,8 @@ KvStoreDataService::KvStoreClientDeathObserverImpl::~KvStoreClientDeathObserverI } } if (uid_ == INVALID_UID || pid_ == INVALID_PID || token_ == INVALID_TOKEN || !appId_.IsValid()) { + ZLOGE("invalid params:pid:%{public}d uid:%{public}d token:%{public}u appId:%{public}s", + uid_, pid_, token_, Anonymous::Change(appId_.appId).c_str()); return; } dataService_.features_.ForEachCopies([this](const auto &, sptr &value) { @@ -885,7 +885,6 @@ KvStoreDataService::KvStoreClientDeathObserverImpl::KvStoreDeathRecipient::KvSto KvStoreClientDeathObserverImpl &kvStoreClientDeathObserverImpl) : kvStoreClientDeathObserverImpl_(kvStoreClientDeathObserverImpl) { - ZLOGD("KvStore Client Death Observer"); } KvStoreDataService::KvStoreClientDeathObserverImpl::KvStoreDeathRecipient::~KvStoreDeathRecipient() @@ -897,7 +896,6 @@ void KvStoreDataService::KvStoreClientDeathObserverImpl::KvStoreDeathRecipient:: const wptr &remote) { (void) remote; - ZLOGD("begin"); if (!clientDead_.exchange(true)) { kvStoreClientDeathObserverImpl_.NotifyClientDie(); } -- Gitee From 3ff2534adbd972629acbb8b23eafe5befe73c608 Mon Sep 17 00:00:00 2001 From: yangliu Date: Thu, 12 Jun 2025 17:38:04 +0800 Subject: [PATCH 3/4] update Signed-off-by: yangliu --- services/distributeddataservice/app/src/kvstore_data_service.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/services/distributeddataservice/app/src/kvstore_data_service.cpp b/services/distributeddataservice/app/src/kvstore_data_service.cpp index 457c7c6f3..b83da4bdc 100644 --- a/services/distributeddataservice/app/src/kvstore_data_service.cpp +++ b/services/distributeddataservice/app/src/kvstore_data_service.cpp @@ -780,7 +780,6 @@ KvStoreDataService::KvStoreClientDeathObserverImpl::KvStoreClientDeathObserverIm pid_ = IPCSkeleton::GetCallingPid(); token_ = IPCSkeleton::GetCallingTokenID(); if (observer != nullptr) { - ZLOGD("add death recipient"); observer->AddDeathRecipient(deathRecipient_); observerProxy_.insert_or_assign(featureName, std::move(observer)); } else { -- Gitee From 9ea1bc63645c252f34431d63a79f2c1264a3f2a4 Mon Sep 17 00:00:00 2001 From: yangliu Date: Thu, 12 Jun 2025 21:32:12 +0800 Subject: [PATCH 4/4] update Signed-off-by: yangliu --- .../distributeddataservice/app/src/kvstore_data_service.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/services/distributeddataservice/app/src/kvstore_data_service.cpp b/services/distributeddataservice/app/src/kvstore_data_service.cpp index b83da4bdc..bc8ba2f85 100644 --- a/services/distributeddataservice/app/src/kvstore_data_service.cpp +++ b/services/distributeddataservice/app/src/kvstore_data_service.cpp @@ -271,7 +271,6 @@ int32_t KvStoreDataService::Exit(const std::string &featureName) } Status KvStoreDataService::AppExit(pid_t uid, pid_t pid, uint32_t token, const AppId &appId) { - ZLOGD("AppExit"); // memory of parameter appId locates in a member of clientDeathObserverMap_ and will be freed after // clientDeathObserverMap_ erase, so we have to take a copy if we want to use this parameter after erase operation. AppId appIdTmp = appId; @@ -821,8 +820,6 @@ KvStoreDataService::KvStoreClientDeathObserverImpl::~KvStoreClientDeathObserverI } } if (uid_ == INVALID_UID || pid_ == INVALID_PID || token_ == INVALID_TOKEN || !appId_.IsValid()) { - ZLOGE("invalid params:pid:%{public}d uid:%{public}d token:%{public}u appId:%{public}s", - uid_, pid_, token_, Anonymous::Change(appId_.appId).c_str()); return; } dataService_.features_.ForEachCopies([this](const auto &, sptr &value) { @@ -884,6 +881,7 @@ KvStoreDataService::KvStoreClientDeathObserverImpl::KvStoreDeathRecipient::KvSto KvStoreClientDeathObserverImpl &kvStoreClientDeathObserverImpl) : kvStoreClientDeathObserverImpl_(kvStoreClientDeathObserverImpl) { + ZLOGD("KvStore Client Death Observer"); } KvStoreDataService::KvStoreClientDeathObserverImpl::KvStoreDeathRecipient::~KvStoreDeathRecipient() -- Gitee