Skip to content

Commit 4c5476b

Browse files
authored
DPL: report state for DataRelayer::processDanglingInputs (#3002)
1 parent 592abbf commit 4c5476b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Framework/Core/include/Framework/DataRelayer.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ class DataRelayer
6060
/// This invokes the appropriate `InputRoute::danglingChecker` on every
6161
/// entry in the cache and if it returns true, it creates a new
6262
/// cache entry by invoking the associated `InputRoute::expirationHandler`.
63-
void processDanglingInputs(std::vector<ExpirationHandler> const&,
63+
/// @return true if there were expirations, false if not.
64+
bool processDanglingInputs(std::vector<ExpirationHandler> const&,
6465
ServiceRegistry& context);
6566

6667
/// This is used to ask for relaying a given (header,payload) pair.

Framework/Core/src/DataRelayer.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,19 @@ DataRelayer::DataRelayer(const CompletionPolicy& policy,
6868
}
6969
}
7070

71-
void DataRelayer::processDanglingInputs(std::vector<ExpirationHandler> const& expirationHandlers,
71+
bool DataRelayer::processDanglingInputs(std::vector<ExpirationHandler> const& expirationHandlers,
7272
ServiceRegistry& services)
7373
{
7474
/// Nothing to do if nothing can expire.
7575
if (expirationHandlers.empty()) {
76-
return;
76+
return false;
7777
}
7878
// Create any slot for the time based fields
7979
std::vector<TimesliceSlot> slotsCreatedByHandlers;
8080
for (auto& handler : expirationHandlers) {
8181
slotsCreatedByHandlers.push_back(handler.creator(mTimesliceIndex));
8282
}
83+
bool didWork = slotsCreatedByHandlers.empty() == false;
8384
// Outer loop, we process all the records because the fact that the record
8485
// expires is independent from having received data for it.
8586
for (size_t ti = 0; ti < mTimesliceIndex.size(); ++ti) {
@@ -114,11 +115,13 @@ void DataRelayer::processDanglingInputs(std::vector<ExpirationHandler> const& ex
114115
assert(ti * mDistinctRoutesIndex.size() + expirator.routeIndex.value < mCache.size());
115116
assert(expirator.handler);
116117
expirator.handler(services, part, timestamp.value);
118+
didWork = true;
117119
mTimesliceIndex.markAsDirty(slot, true);
118120
assert(part.header != nullptr);
119121
assert(part.payload != nullptr);
120122
}
121123
}
124+
return didWork;
122125
}
123126

124127
/// This does the mapping between a route and a InputSpec. The

0 commit comments

Comments
 (0)