Skip to content

Commit 998c340

Browse files
committed
stfs: contact scheduler after starting RPC server
1 parent 48b5a73 commit 998c340

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

src/StfSender/StfSenderDevice.cxx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,6 @@ void StfSenderDevice::InitTask()
9696
void StfSenderDevice::PreRun()
9797
{
9898
if (!mStandalone) {
99-
while (!mTfSchedulerRpcClient.start(mDiscoveryConfig)) {
100-
101-
// try to reach the scheduler unless we should exit
102-
if (IsRunningState() && NewStatePending()) {
103-
return;
104-
}
105-
106-
std::this_thread::sleep_for(250ms);
107-
}
108-
10999
// Start output handler
110100
mOutputHandler.start(mDiscoveryConfig);
111101

@@ -115,6 +105,15 @@ void StfSenderDevice::PreRun()
115105
mRpcServer.start(&mOutputHandler, lStatus.info().ip_address(), lRpcRealPort);
116106
lStatus.set_rpc_endpoint(lStatus.info().ip_address() + ":" + std::to_string(lRpcRealPort));
117107
mDiscoveryConfig->write();
108+
109+
// contact the scheduler on gRPC
110+
while (!mTfSchedulerRpcClient.start(mDiscoveryConfig)) {
111+
// try to reach the scheduler unless we should exit
112+
if (!IsReadyOrRunningState()) {
113+
return;
114+
}
115+
std::this_thread::sleep_for(250ms);
116+
}
118117
}
119118

120119
// start file sink

0 commit comments

Comments
 (0)