diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000000000000000000000000000000000..e1b3d95468796bcb1e340b3f5ea11450f18ba366 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "filesystem": "cpp" + } +} \ No newline at end of file diff --git a/services/distributeddataservice/framework/store/auto_cache.cpp b/services/distributeddataservice/framework/store/auto_cache.cpp index d65c9dee579e8a3a497c96f5b399b5fbf6ed06a1..2863e29d0ebe0e963a346286f6684cd657ddb6e5 100644 --- a/services/distributeddataservice/framework/store/auto_cache.cpp +++ b/services/distributeddataservice/framework/store/auto_cache.cpp @@ -172,18 +172,19 @@ void AutoCache::StartTimer() void AutoCache::CloseStore(uint32_t tokenId, const std::string &path, const std::string &storeId) { - ZLOGD("close store start, store:%{public}s, token:%{public}u", Anonymous::Change(storeId).c_str(), tokenId); + ZLOGI("yltest close store start, store:%{public}s, token:%{public}u", Anonymous::Change(storeId).c_str(), tokenId); std::set storeIds; std::list closeStores; bool isScreenLocked = ScreenManager::GetInstance()->IsLocked(); auto storeKey = GenerateKey(path, storeId); stores_.ComputeIfPresent(tokenId, - [this, &storeKey, isScreenLocked, &storeIds, &closeStores](auto &, auto &delegates) { + [this, &storeKey, isScreenLocked, &storeIds, &closeStores, &tokenId](auto &, auto &delegates) { auto it = delegates.begin(); while (it != delegates.end()) { if ((it->first == storeKey || storeKey.empty()) && (!isScreenLocked || it->second.GetArea() != GeneralStore::EL4) && disableStores_.count(it->second.GetDataDir()) == 0) { + ZLOGI("yltest11 close store start, store:%{public}s, token:%{public}u", Anonymous::Change(it->first).c_str(), tokenId); disableStores_.insert(it->second.GetDataDir()); storeIds.insert(it->first); closeStores.emplace(closeStores.end(), it->second); @@ -193,9 +194,10 @@ void AutoCache::CloseStore(uint32_t tokenId, const std::string &path, const std: return !delegates.empty(); }); closeStores.clear(); - stores_.ComputeIfPresent(tokenId, [this, &storeIds](auto &key, auto &delegates) { + stores_.ComputeIfPresent(tokenId, [this, &storeIds, &tokenId](auto &key, auto &delegates) { for (auto it = delegates.begin(); it != delegates.end();) { if (storeIds.count(it->first) != 0) { + ZLOGI("yltest222 close store start, store:%{public}s, token:%{public}u", Anonymous::Change(it->first).c_str(), tokenId); disableStores_.erase(it->second.GetDataDir()); it = delegates.erase(it); } else { @@ -340,6 +342,7 @@ bool AutoCache::Delegate::Close() if (store_ != nullptr) { auto status = store_->Close(); if (status == Error::E_BUSY) { + ZLOGI("yltest444 close store busy"); return false; } store_->Unwatch(Origin::ORIGIN_ALL, *this); diff --git a/services/distributeddataservice/service/kvdb/kvdb_general_store.cpp b/services/distributeddataservice/service/kvdb/kvdb_general_store.cpp index f18d59547fa5cbb3b8d3605abf5c8d9c1dba174c..a0a4ba09688bb004042db946e7c9ffaf190d7244 100644 --- a/services/distributeddataservice/service/kvdb/kvdb_general_store.cpp +++ b/services/distributeddataservice/service/kvdb/kvdb_general_store.cpp @@ -290,11 +290,13 @@ int32_t KVDBGeneralStore::Close(bool isForce) return GeneralError::E_OK; } if (!isForce && delegate_->GetTaskCount() > 0) { + ZLOGW("yltest666 Close busy"); return GeneralError::E_BUSY; } if (delegate_ != nullptr) { delegate_->UnRegisterObserver(&observer_); } + ZLOGW("yltest777 CloseKvStore"); auto status = manager_.CloseKvStore(delegate_); if (status != DBStatus::OK) { return status; diff --git a/services/distributeddataservice/service/kvdb/kvdb_service_impl.cpp b/services/distributeddataservice/service/kvdb/kvdb_service_impl.cpp index cde27ab2236fbb7d308dacfea27cc0957570bcc1..253c66a02fa914c209e80417f4f5af0a2148f727 100644 --- a/services/distributeddataservice/service/kvdb/kvdb_service_impl.cpp +++ b/services/distributeddataservice/service/kvdb/kvdb_service_impl.cpp @@ -205,9 +205,9 @@ Status KVDBServiceImpl::Delete(const AppId &appId, const StoreId &storeId, int32 MetaDataManager::GetInstance().DelMeta(metaData.GetDebugInfoKey(), true); MetaDataManager::GetInstance().DelMeta(metaData.GetCloneSecretKey(), true); PermitDelegate::GetInstance().DelCache(metaData.GetKeyWithoutPath()); - AutoCache::GetInstance().CloseStore(metaData.tokenId, metaData.dataDir); - ZLOGD("appId:%{public}s storeId:%{public}s instanceId:%{public}d", appId.appId.c_str(), - Anonymous::Change(storeId.storeId).c_str(), metaData.instanceId); + AutoCache::GetInstance().CloseStore(metaData.tokenId, metaData.dataDir, storeId); + ZLOGI("yltest appId:%{public}s storeId:%{public}s instanceId:%{public}d dir:%{public}s", appId.appId.c_str(), + Anonymous::Change(storeId.storeId).c_str(), metaData.instanceId, metaData.dataDir.c_str()); return SUCCESS; } diff --git a/services/distributeddataservice/service/kvdb/kvdb_service_stub.cpp b/services/distributeddataservice/service/kvdb/kvdb_service_stub.cpp index acfa5fbdb03ae7970492bd34f73aabe8c7371b8e..57c0e69bafe9387109baa5c9964d1a07e04d47a6 100644 --- a/services/distributeddataservice/service/kvdb/kvdb_service_stub.cpp +++ b/services/distributeddataservice/service/kvdb/kvdb_service_stub.cpp @@ -188,6 +188,7 @@ int32_t KVDBServiceStub::OnDelete(const AppId &appId, const StoreId &storeId, Me Anonymous::Change(storeId.storeId).c_str()); return IPC_STUB_INVALID_DATA_ERR; } + ZLOGI("YLTEST storeid:%{public}s", storeId.storeId.c_str()); int32_t status = Delete(appId, storeId, subUser); if (!ITypesUtil::Marshal(reply, status)) { ZLOGE("Marshal status:0x%{public}x appId:%{public}s storeId:%{public}s", status, appId.appId.c_str(),