Skip to content

Commit

Permalink
HPCC-30362 Fix setSlaveAffinity regression (since 7.8)
Browse files Browse the repository at this point in the history
setSlaveAffinity needed to be called after the worker had
registered with the manager, only then are the thor
configuration settings available, and in particular
slavesPerNode which setSlaveAffinity depends upon.

Signed-off-by: Jake Smith <[email protected]>
  • Loading branch information
jakesmith committed Sep 26, 2023
1 parent 2b038c1 commit 2494d9a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions thorlcr/slave/thslavemain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,9 @@ int main( int argc, const char *argv[] )
globals.setown(loadConfiguration(globals, argv, "thor", "THOR", nullptr, nullptr, nullptr, false));
#endif

// NB: the thor configuration is serialized from the manager and only available after the RegisterSelf
// Until that point, only properties on the command line are available.

const char *master = globals->queryProp("@master");
if (!master)
usage();
Expand Down Expand Up @@ -411,10 +414,6 @@ int main( int argc, const char *argv[] )
slfEp.port = queryMyNode()->endpoint().port;
setMachinePortBase(slfEp.port);

setSlaveAffinity(globals->getPropInt("@slaveprocessnum"));

if (globals->getPropBool("@MPChannelReconnect"))
getMPServer()->setOpt(mpsopt_channelreopen, "true");
#ifdef USE_MP_LOG
startLogMsgParentReceiver();
LOG(MCdebugProgress, thorJob, "MPServer started on port %d", getFixedPort(TPORT_mp));
Expand All @@ -430,6 +429,11 @@ int main( int argc, const char *argv[] )
if (!slaveLogHandler)
slaveLogHandler = startSlaveLog();

setSlaveAffinity(globals->getPropInt("@slaveprocessnum"));

if (globals->getPropBool("@MPChannelReconnect"))
getMPServer()->setOpt(mpsopt_channelreopen, "true");

if (getExpertOptBool("slaveDaliClient"))
enableThorSlaveAsDaliClient();

Expand Down

0 comments on commit 2494d9a

Please sign in to comment.