From 2494d9a245be788ad69b40dcff42034f80394406 Mon Sep 17 00:00:00 2001 From: Jake Smith Date: Tue, 26 Sep 2023 15:30:01 +0100 Subject: [PATCH] HPCC-30362 Fix setSlaveAffinity regression (since 7.8) 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 --- thorlcr/slave/thslavemain.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/thorlcr/slave/thslavemain.cpp b/thorlcr/slave/thslavemain.cpp index dccf3e0d100..e9569f5dcaf 100644 --- a/thorlcr/slave/thslavemain.cpp +++ b/thorlcr/slave/thslavemain.cpp @@ -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(); @@ -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)); @@ -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();