Skip to content

Commit

Permalink
Merge pull request #18391 from ghalliday/ftjoin
Browse files Browse the repository at this point in the history
HPCC-31420 Ensure threads are joined inside the dfu copy code

Reviewed-By: Shamser Ahmed <shamser.ahmed@lexisnexis.com>
Merged-by: Gavin Halliday <ghalliday@hpccsystems.com>
  • Loading branch information
ghalliday authored Mar 28, 2024
2 parents 52e9e0e + 839bf57 commit a6d141d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dali/ft/daftformat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1974,6 +1974,10 @@ void CRemotePartitioner::callRemote()

void CRemotePartitioner::getResults(PartitionPointArray & partition)
{
#ifdef RUN_SLAVES_ON_THREADS
join();
#endif

if (error)
throw error.getLink();

Expand Down
8 changes: 8 additions & 0 deletions dali/ft/filecopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2033,6 +2033,8 @@ void FileSprayer::gatherFileSizes(FilePartInfoArray & fileSizeQueue, bool errorI
if (alldone)
break;
}
for (idx = 0; idx < numThreads; idx++)
threads.item(idx).join();
for (idx = 0; idx < numThreads; idx++)
threads.item(idx).queryThrowError();
}
Expand Down Expand Up @@ -2566,6 +2568,12 @@ void FileSprayer::performTransfer()
numSlavesCompleted++;
}

#ifdef RUN_SLAVES_ON_THREADS
//Ensure that the transfer slave threads have terminated before continuing
ForEachItemIn(idx4, transferSlaves)
transferSlaves.item(idx4).join();
#endif

if (error)
throw LINK(error);

Expand Down

0 comments on commit a6d141d

Please sign in to comment.