Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erjiaqing committed Jun 8, 2022
1 parent 76f635a commit 4ed3d16
Show file tree
Hide file tree
Showing 2 changed files with 929 additions and 326 deletions.
10 changes: 6 additions & 4 deletions src/app/InteractionModelEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,8 +821,8 @@ bool InteractionModelEngine::TrimFabricForRead(FabricIndex aFabricIndex)
{
candidate = handler;
}
// This handler is older than the one we picked before.
else if (handler->GetTransactionStartGeneration() < candidate->GetTransactionStartGeneration() &&
// This handler is younger than the one we picked before, should evict the younger one.
else if (handler->GetTransactionStartGeneration() > candidate->GetTransactionStartGeneration() &&
// And the level of resource usage is the same (both exceed or neither exceed)
((attributePathsUsed > kMinSupportedPathsPerReadRequest || eventPathsUsed > kMinSupportedPathsPerReadRequest) ==
(candidateAttributePathsUsed > kMinSupportedPathsPerReadRequest ||
Expand Down Expand Up @@ -932,7 +932,7 @@ Protocols::InteractionModel::Status InteractionModelEngine::EnsureResourceForRea
return Loop::Continue;
});

// Resources exhausted, since there is already some read requests ongoing on this fabric, please retry later.
// Busy, since there is already some read requests ongoing on this fabric, please retry later.
if (usedAttributePathsInFabric + aRequestedAttributePathCount >
kMinSupportedPathsPerReadRequest * guaranteedReadRequestsPerFabric ||
usedEventPathsInFabric + aRequestedEventPathCount > kMinSupportedPathsPerReadRequest * guaranteedReadRequestsPerFabric ||
Expand Down Expand Up @@ -962,7 +962,9 @@ Protocols::InteractionModel::Status InteractionModelEngine::EnsureResourceForRea
{
break;
}
if (didEvictHandler)
// If the fabric table is full, we won't evict read requests from normal fabrics before we have evicted all read requests
// from PASE sessions.
if (mpFabricTable->FabricCount() == GetConfigMaxFabrics() && didEvictHandler)
{
continue;
}
Expand Down
Loading

0 comments on commit 4ed3d16

Please sign in to comment.