SL-19533 Reduce inventory fetch stalls
parent
154ab03bf8
commit
c008d3e030
|
|
@ -771,7 +771,7 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht
|
|||
|
||||
LL_DEBUGS("Inventory") << "Request type: " << (S32)type
|
||||
<< " \nRequest target: " << targetId
|
||||
<< " \nElapsed time ince request: " << elapsed_time
|
||||
<< " \nElapsed time since request: " << elapsed_time
|
||||
<< " \nstatus: " << status.toULong() << LL_ENDL;
|
||||
}
|
||||
else
|
||||
|
|
@ -904,6 +904,8 @@ AISUpdate::AISUpdate(const LLSD& update, bool fetch, S32 depth)
|
|||
: mFetch(fetch)
|
||||
, mFetchDepth(depth)
|
||||
{
|
||||
mTimer.setTimerExpirySec(debugLoggingEnabled("Inventory") ? EXPIRY_SECONDS_DEBUG : EXPIRY_SECONDS_LIVE);
|
||||
mTimer.start();
|
||||
parseUpdate(update);
|
||||
}
|
||||
|
||||
|
|
@ -1279,6 +1281,13 @@ void AISUpdate::parseDescendentCount(const LLUUID& category_id, const LLSD& embe
|
|||
|
||||
void AISUpdate::parseEmbedded(const LLSD& embedded, S32 depth)
|
||||
{
|
||||
if (mTimer.hasExpired())
|
||||
{
|
||||
llcoro::suspend();
|
||||
LLCoros::checkStop();
|
||||
mTimer.setTimerExpirySec(debugLoggingEnabled("Inventory") ? EXPIRY_SECONDS_DEBUG : EXPIRY_SECONDS_LIVE);
|
||||
}
|
||||
|
||||
if (embedded.has("links")) // _embedded in a category
|
||||
{
|
||||
parseEmbeddedLinks(embedded["links"]);
|
||||
|
|
|
|||
|
|
@ -124,6 +124,11 @@ public:
|
|||
private:
|
||||
void clearParseResults();
|
||||
|
||||
// Debug is very log-heavy, give it more time or it will take forever to process
|
||||
// Todo: find a way to make throttle static isntead of per-request
|
||||
const F32 EXPIRY_SECONDS_DEBUG = 1.f;
|
||||
const F32 EXPIRY_SECONDS_LIVE = 0.01f;
|
||||
|
||||
typedef std::map<LLUUID,S32> uuid_int_map_t;
|
||||
uuid_int_map_t mCatDescendentDeltas;
|
||||
uuid_int_map_t mCatDescendentsKnown;
|
||||
|
|
@ -144,6 +149,7 @@ private:
|
|||
uuid_list_t mCategoryIds;
|
||||
bool mFetch;
|
||||
S32 mFetchDepth;
|
||||
LLTimer mTimer;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -195,11 +195,6 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
|
|||
return true;
|
||||
}
|
||||
|
||||
if(!checkAgainstFilterThumbnails(folder_id))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// when applying a filter, matching folders get their contents downloaded first
|
||||
// but make sure we are not interfering with pre-download
|
||||
if (isNotDefault()
|
||||
|
|
@ -207,7 +202,7 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
|
|||
&& !LLInventoryModelBackgroundFetch::instance().inventoryFetchInProgress())
|
||||
{
|
||||
LLViewerInventoryCategory* cat = gInventory.getCategory(folder_id);
|
||||
if (!cat || (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN))
|
||||
if ((!cat && folder_id.notNull()) || (cat && cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN))
|
||||
{
|
||||
// At the moment background fetch only cares about VERSION_UNKNOWN,
|
||||
// so do not check isCategoryComplete that compares descendant count
|
||||
|
|
@ -215,6 +210,11 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
|
|||
}
|
||||
}
|
||||
|
||||
if (!checkAgainstFilterThumbnails(folder_id))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Marketplace folder filtering
|
||||
const U32 filterTypes = mFilterOps.mFilterTypes;
|
||||
const U32 marketplace_filter = FILTERTYPE_MARKETPLACE_ACTIVE | FILTERTYPE_MARKETPLACE_INACTIVE |
|
||||
|
|
|
|||
|
|
@ -4681,7 +4681,6 @@ LLPointer<LLInventoryValidationInfo> LLInventoryModel::validate() const
|
|||
}
|
||||
else if (count_under_root > 1)
|
||||
{
|
||||
LL_WARNS("Inventory") << "Fatal inventory corruption: system folder type has excess copies under root, type " << ft << " count " << count_under_root << LL_ENDL;
|
||||
validation_info->mDuplicateRequiredSystemFolders.insert(folder_type);
|
||||
if (!is_automatic && folder_type != LLFolderType::FT_SETTINGS)
|
||||
{
|
||||
|
|
@ -4689,6 +4688,7 @@ LLPointer<LLInventoryValidationInfo> LLInventoryModel::validate() const
|
|||
// outfits, trash and other non-automatic folders.
|
||||
validation_info->mFatalSystemDuplicate++;
|
||||
fatal_errs++;
|
||||
LL_WARNS("Inventory") << "Fatal inventory corruption: system folder type has excess copies under root, type " << ft << " count " << count_under_root << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -4697,6 +4697,7 @@ LLPointer<LLInventoryValidationInfo> LLInventoryModel::validate() const
|
|||
// Exception: FT_SETTINGS is not automatic, but only deserves a warning.
|
||||
validation_info->mWarnings["non_fatal_system_duplicate_under_root"]++;
|
||||
warning_count++;
|
||||
LL_WARNS("Inventory") << "System folder type has excess copies under root, type " << ft << " count " << count_under_root << LL_ENDL;
|
||||
}
|
||||
}
|
||||
if (count_elsewhere > 0)
|
||||
|
|
|
|||
|
|
@ -555,6 +555,8 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis()
|
|||
}
|
||||
|
||||
static LLCachedControl<U32> ais_pool(gSavedSettings, "PoolSizeAIS", 20);
|
||||
// Don't have too many requests at once
|
||||
// Reserve one request for actions outside of fetch (like renames)
|
||||
const U32 max_concurrent_fetches = llmax(1, ais_pool - 1);
|
||||
|
||||
if (mFetchCount >= max_concurrent_fetches)
|
||||
|
|
@ -562,6 +564,9 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis()
|
|||
return;
|
||||
}
|
||||
|
||||
// Don't fire all requests at once
|
||||
const U32 max_requests_this_run = llmin(mFetchCount + 5, max_concurrent_fetches);
|
||||
|
||||
// Don't loop for too long (in case of large, fully loaded inventory)
|
||||
F64 curent_time = LLTimer::getTotalSeconds();
|
||||
const F64 max_time = LLStartUp::getStartupState() > STATE_WEARABLES_WAIT
|
||||
|
|
@ -570,7 +575,7 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis()
|
|||
const F64 end_time = curent_time + max_time;
|
||||
S32 last_fetch_count = mFetchCount;
|
||||
|
||||
while (!mFetchFolderQueue.empty() && mFetchCount < max_concurrent_fetches && curent_time < end_time)
|
||||
while (!mFetchFolderQueue.empty() && mFetchCount < max_requests_this_run && curent_time < end_time)
|
||||
{
|
||||
const FetchQueueInfo & fetch_info(mFetchFolderQueue.front());
|
||||
bulkFetchViaAis(fetch_info);
|
||||
|
|
@ -581,7 +586,7 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis()
|
|||
// Ideally we shouldn't fetch items if recursive fetch isn't done,
|
||||
// but there is a chance some request will start timeouting and recursive
|
||||
// fetch will get stuck on a signle folder, don't block item fetch in such case
|
||||
while (!mFetchItemQueue.empty() && mFetchCount < max_concurrent_fetches && curent_time < end_time)
|
||||
while (!mFetchItemQueue.empty() && mFetchCount < max_requests_this_run && curent_time < end_time)
|
||||
{
|
||||
const FetchQueueInfo& fetch_info(mFetchItemQueue.front());
|
||||
bulkFetchViaAis(fetch_info);
|
||||
|
|
|
|||
Loading…
Reference in New Issue