Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix, start Services in runOrQueueEventSetupForInstanceAsync #39644

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions FWCore/Framework/interface/EventSetupsController.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ namespace edm {
class ParameterSet;
class IOVSyncValue;
class ModuleTypeResolverBase;
class ServiceToken;
class WaitingTaskHolder;
class WaitingTaskList;

Expand Down Expand Up @@ -103,6 +104,7 @@ namespace edm {
std::vector<std::shared_ptr<const EventSetupImpl>>&,
edm::SerialTaskQueue& queueWhichWaitsForIOVsToFinish,
ActivityRegistry*,
ServiceToken const&,
bool iForceCacheClear = false);

// Pass in an IOVSyncValue to let the EventSetup system know which run and lumi
Expand Down
7 changes: 5 additions & 2 deletions FWCore/Framework/src/EventProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,7 @@ namespace edm {
status->eventSetupImpls(),
queueWhichWaitsForIOVsToFinish_,
actReg_.get(),
serviceToken_,
forceESCacheClearOnNewRun_);
}) | chain::then([this, status, iSync](std::exception_ptr const* iException, auto nextTask) {
CMS_SA_ALLOW try {
Expand Down Expand Up @@ -1428,7 +1429,8 @@ namespace edm {
iRunStatus->endIOVWaitingTasksEndRun(),
iRunStatus->eventSetupImplsEndRun(),
queueWhichWaitsForIOVsToFinish_,
actReg_.get());
actReg_.get(),
serviceToken_);
}) | chain::then([this, iRunStatus, ts](std::exception_ptr const* iException, auto nextTask) {
if (iException) {
iRunStatus->setEndingEventSetupSucceeded(false);
Expand Down Expand Up @@ -1632,7 +1634,8 @@ namespace edm {
status->endIOVWaitingTasks(),
status->eventSetupImpls(),
queueWhichWaitsForIOVsToFinish_,
actReg_.get());
actReg_.get(),
serviceToken_);
}) | chain::then([this, status, iRunStatus, iSync](std::exception_ptr const* iException, auto nextTask) {
CMS_SA_ALLOW try {
//the call to doneWaiting will cause the count to decrement
Expand Down
12 changes: 9 additions & 3 deletions FWCore/Framework/src/EventSetupsController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include "FWCore/Framework/interface/ParameterSetIDHolder.h"
#include "FWCore/Framework/src/SendSourceTerminationSignalIfException.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/ServiceRegistry.h"
#include "FWCore/ServiceRegistry/interface/ServiceToken.h"
#include "FWCore/Utilities/interface/EDMException.h"
#include "FWCore/Utilities/interface/thread_safety_macros.h"

Expand Down Expand Up @@ -100,6 +102,7 @@ namespace edm {
std::vector<std::shared_ptr<const EventSetupImpl>>& eventSetupImpls,
edm::SerialTaskQueue& queueWhichWaitsForIOVsToFinish,
ActivityRegistry* actReg,
ServiceToken const& iToken,
bool iForceCacheClear) {
auto asyncEventSetup =
[this, &endIOVWaitingTasks, &eventSetupImpls, &queueWhichWaitsForIOVsToFinish, actReg, iForceCacheClear](
Expand All @@ -123,9 +126,12 @@ namespace edm {
// and the new sync value is outside the current IOV of that module.
// Also at beginRun when forcing caches to clear.
auto group = taskToStartAfterIOVInit.group();
queueWhichWaitsForIOVsToFinish.push(*group, [iSync, taskToStartAfterIOVInit, asyncEventSetup]() mutable {
asyncEventSetup(iSync, taskToStartAfterIOVInit);
});
ServiceWeakToken weakToken = iToken;
queueWhichWaitsForIOVsToFinish.push(*group,
[iSync, taskToStartAfterIOVInit, asyncEventSetup, weakToken]() mutable {
ServiceRegistry::Operate operate(weakToken.lock());
asyncEventSetup(iSync, taskToStartAfterIOVInit);
});
} else {
asyncEventSetup(iSync, taskToStartAfterIOVInit);
}
Expand Down