Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/candidate-9.6.x'
Browse files Browse the repository at this point in the history
Signed-off-by: Gordon Smith <[email protected]>
  • Loading branch information
GordonSmith committed Jun 20, 2024
2 parents 683bc67 + 57b53ea commit 63341d8
Show file tree
Hide file tree
Showing 44 changed files with 4,691 additions and 2,192 deletions.
14 changes: 11 additions & 3 deletions common/workunit/wujobq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1122,11 +1122,19 @@ class CJobQueue: public CJobQueueBase, implements IJobQueue
void disconnect() // signal no longer wil be dequeing (optional - done automatically on release)
{
Cconnlockblock block(this,true);
if (connected) {
if (connected)
{
dounsubscribe();
ForEachQueue(qd) {
ForEachQueue(qd)
{
IPropertyTree *croot = queryClientRootSession(*qd);
croot->setPropInt64("@connected",croot->getPropInt64("@connected",0)-1);
unsigned connectedCount = croot->getPropInt64("@connected");
if (connectedCount) // should never be 0, but guard JIC
connectedCount--;
if (connectedCount)
croot->setPropInt64("@connected", connectedCount);
else
qd->root->removeTree(croot);
}
connected = false;
}
Expand Down
13 changes: 13 additions & 0 deletions dali/base/dasds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4938,6 +4938,18 @@ void initializeInternals(IPropertyTree *root)
root->addPropTree("Status/Servers",createPTree());
}

void clearStaleMeteData(IPropertyTree *root)
{
// JobQueues
// Remove all Client entries from all queues. By definition they are stale (they should normally be removed when the client disconnects)
Owned<IPropertyTreeIterator> jobQueues = root->getElements("JobQueues/Queue");
ForEach(*jobQueues)
{
IPropertyTree &queue = jobQueues->query();
while (queue.removeProp("Client"));
}
}

IPropertyTree *loadStore(const char *storeFilename, unsigned edition, IPTreeMaker *iMaker, unsigned crcValidation, bool logErrorsOnly=false, const bool *abort=NULL)
{
CHECKEDCRITICALBLOCK(loadStoreCrit, fakeCritTimeout);
Expand Down Expand Up @@ -6543,6 +6555,7 @@ void CCovenSDSManager::loadStore(const char *storeName, const bool *abort)
}
Owned<IRemoteConnection> conn = connect("/", 0, RTM_INTERNAL, INFINITE);
initializeInternals(conn->queryRoot());
clearStaleMeteData(conn->queryRoot());
conn.clear();
initializeStorageGroups(oldEnvironment);
}
Expand Down
Loading

0 comments on commit 63341d8

Please sign in to comment.