Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-31210 Fix publisher workunit task failure tracking gets out of sync #18389

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions dali/dfu/dfuwu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,14 @@ static StringBuffer &getSubTaskParentXPath(StringBuffer &wuRoot, const char *wui
return wuRoot.append('/').append(wuid);
}

static bool isSubTaskWuid(const char *subtaskWuid)
{
return (!isEmptyString(subtaskWuid) && 'P'==*subtaskWuid && strchr(subtaskWuid, 'T')!=nullptr);
}

static bool notePublisherSubTaskState(const char *subtaskWuid, DFUstate state)
{
if (!subtaskWuid || 'P'!=*subtaskWuid || !strchr(subtaskWuid, 'T'))
if (!isSubTaskWuid(subtaskWuid))
return false;
switch (state)
{
Expand Down Expand Up @@ -699,6 +704,7 @@ class CDFUprogress: public CLinkedDFUWUchild, implements IDFUprogress
queryRoot()->removeProp("@kbpersecave");
queryRoot()->removeProp("@kbpersec");
queryRoot()->removeProp("@slavesdone");
queryRoot()->removeProp("@noted");
parent->commit();
}
void setDone(const char * timeTaken, unsigned kbPerSec, bool set100pc)
Expand All @@ -718,6 +724,8 @@ class CDFUprogress: public CLinkedDFUWUchild, implements IDFUprogress
{
CriticalBlock block(parent->crit);
CDateTime dt;
bool noted = queryRoot()->getPropBool("@noted", false);
bool subtask = isSubTaskWuid(parent->queryId());
switch (state) {
case DFUstate_started:
dt.setNow();
Expand All @@ -737,13 +745,17 @@ class CDFUprogress: public CLinkedDFUWUchild, implements IDFUprogress
state = DFUstate_aborted;
dt.setNow();
setTimeStopped(dt);
if (subtask && !noted)
queryRoot()->setPropBool("@noted", true);
break;
}
StringBuffer s;
encodeDFUstate(state,s);
queryRoot()->setProp("@state",s.str());

parent->commit();
notePublisherSubTaskState(parent->queryId(), state);
if (subtask && !noted)
notePublisherSubTaskState(parent->queryId(), state);
}
void setTimeStarted(const CDateTime &val)
{
Expand Down
Loading