Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/candidate-9.6.x' into candidate-…
Browse files Browse the repository at this point in the history
…9.8.x
  • Loading branch information
jakesmith committed Sep 13, 2024
2 parents c218386 + 0e19669 commit 1a7e141
Show file tree
Hide file tree
Showing 59 changed files with 766 additions and 1,117 deletions.
52 changes: 38 additions & 14 deletions common/workunit/workunit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8759,14 +8759,26 @@ void CLocalWorkUnit::setDebugValue(const char *propname, const char *value, bool
lower.append(propname);
if (!strchr(lower, ':'))
lower.toLowerCase();
CriticalBlock block(crit);
StringBuffer prop("Debug/");
prop.append(lower);
if (overwrite || !p->hasProp(prop.str()))
try
{
// MORE - not sure this line should be needed....
p->setProp("Debug", "");
p->setProp(prop.str(), value);
CriticalBlock block(crit);
StringBuffer prop("Debug/");
prop.append(lower);
if (overwrite || !p->hasProp(prop.str()))
{
// MORE - not sure this line should be needed....
p->setProp("Debug", "");
p->setProp(prop.str(), value);
}
}
catch (IException * e)
{
if (!validateXMLTag(propname))
{
e->Release();
throw makeStringExceptionV(WUERR_InvalidDebugValueName, "Attempt to set debug value with invalid name: %s", propname);
}
throw;
}
}

Expand Down Expand Up @@ -8844,14 +8856,26 @@ void CLocalWorkUnit::setDebugValueInt(const char *propname, int value, bool over
lower.append(propname);
if (!strchr(lower, ':'))
lower.toLowerCase();
CriticalBlock block(crit);
StringBuffer prop("Debug/");
prop.append(lower);
if (overwrite || !p->hasProp(prop.str()))
try
{
// MORE - not sure this line should be needed....
p->setProp("Debug", "");
p->setPropInt(prop.str(), value);
CriticalBlock block(crit);
StringBuffer prop("Debug/");
prop.append(lower);
if (overwrite || !p->hasProp(prop.str()))
{
// MORE - not sure this line should be needed....
p->setProp("Debug", "");
p->setPropInt(prop.str(), value);
}
}
catch (IException * e)
{
if (!validateXMLTag(propname))
{
e->Release();
throw makeStringExceptionV(WUERR_InvalidDebugValueName, "Attempt to set debug value with invalid name: %s", propname);
}
throw;
}
}

Expand Down
1 change: 1 addition & 0 deletions common/workunit/workunit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ enum : unsigned
{
WUERR_ModifyFilterAfterFinalize = WORKUNIT_ERROR_START,
WUERR_FinalizeAfterFinalize,
WUERR_InvalidDebugValueName,
};

// error codes
Expand Down
65 changes: 36 additions & 29 deletions dali/base/dacoven.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1067,33 +1067,40 @@ DALI_UID getGlobalUniqueIds(unsigned num,SocketEndpoint *_foreignnode)
{
if (num==0)
return 0;
if (coven)
return coven->getUniqueIds(num,_foreignnode);
if (!_foreignnode||_foreignnode->isNull())
throw MakeStringException(99,"getUniqueIds: Not connected to dali");
SocketEndpoint foreignnode;
foreignnode.set(*_foreignnode);
if (foreignnode.port==0)
foreignnode.port=DALI_SERVER_PORT;
CDaliUidAllocator &uidAllocator = CDaliUidAllocator::find(CCovenBase::foreginUidallocators,foreignnode);
DALI_UID uid;
CriticalBlock block(uidAllocator.crit);
while (!uidAllocator.allocUIDs(uid,num)) {
unsigned n = uidAllocator.getBankSize();
if (n<num)
n = num*2;
DALI_UID next;
CMessageBuffer mb;
mb.append((int)MCR_ALLOC_UNIQUE_IDS);
mb.append(n);
Owned<ICommunicator> foreign;
Owned<IGroup> group = createIGroup(1,&foreignnode);
foreign.setown(createCommunicator(group));
foreign->sendRecv(mb,RANK_RANDOM,MPTAG_DALI_COVEN_REQUEST);
mb.read(next);
if ((next==0)&&mb.remaining()) // server exception
throw deserializeException(mb);
uidAllocator.addUIDs((__uint64)next,n);
}
return uid;
try
{
if (coven)
return coven->getUniqueIds(num,_foreignnode);
if (!_foreignnode||_foreignnode->isNull())
throw MakeStringException(99,"getUniqueIds: Not connected to dali");
SocketEndpoint foreignnode;
foreignnode.set(*_foreignnode);
if (foreignnode.port==0)
foreignnode.port=DALI_SERVER_PORT;
CDaliUidAllocator &uidAllocator = CDaliUidAllocator::find(CCovenBase::foreginUidallocators,foreignnode);
DALI_UID uid;
CriticalBlock block(uidAllocator.crit);
while (!uidAllocator.allocUIDs(uid,num)) {
unsigned n = uidAllocator.getBankSize();
if (n<num)
n = num*2;
DALI_UID next;
CMessageBuffer mb;
mb.append((int)MCR_ALLOC_UNIQUE_IDS);
mb.append(n);
Owned<ICommunicator> foreign;
Owned<IGroup> group = createIGroup(1,&foreignnode);
foreign.setown(createCommunicator(group));
foreign->sendRecv(mb,RANK_RANDOM,MPTAG_DALI_COVEN_REQUEST);
mb.read(next);
if ((next==0)&&mb.remaining()) // server exception
throw deserializeException(mb);
uidAllocator.addUIDs((__uint64)next,n);
}
return uid;
}
catch (IException *e)
{
throw makeWrappedException(e, e->errorCode(), "getGlobalUniqueIds");
}
}
130 changes: 71 additions & 59 deletions esp/services/ws_workunits/ws_workunitsHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3741,81 +3741,93 @@ void WsWuHelpers::submitWsWorkunit(IEspContext& context, IConstWorkUnit* cw, con
if(!wu.get())
throw MakeStringException(ECLWATCH_CANNOT_UPDATE_WORKUNIT, "Cannot update workunit %s.", wuid.str());

wu->clearExceptions();
if(notEmpty(cluster))
wu->setClusterName(cluster);
if(notEmpty(snapshot))
wu->setSnapshot(snapshot);
wu->setState(WUStateSubmitted);
if (maxruntime)
wu->setDebugValueInt("maxRunTime",maxruntime,true);
if (maxcost)
wu->setDebugValueInt("maxCost", maxcost, true);
if (debugs && debugs->length())
{
ForEachItemIn(i, *debugs)
try
{
wu->clearExceptions();
if(notEmpty(cluster))
wu->setClusterName(cluster);
if(notEmpty(snapshot))
wu->setSnapshot(snapshot);
wu->setState(WUStateSubmitted);
if (maxruntime)
wu->setDebugValueInt("maxRunTime",maxruntime,true);
if (maxcost)
wu->setDebugValueInt("maxCost", maxcost, true);
if (debugs && debugs->length())
{
IConstNamedValue &item = debugs->item(i);
const char *name = item.getName();
const char *value = item.getValue();
if (!name || !*name)
continue;
StringBuffer expanded;
if (*name=='-')
name=expanded.append("eclcc").append(name).str();
if (!value)
ForEachItemIn(i, *debugs)
{
size_t len = strlen(name);
char last = name[len-1];
if (last == '-' || last == '+')
IConstNamedValue &item = debugs->item(i);
const char *name = item.getName();
const char *value = item.getValue();
if (!name || !*name)
continue;
StringBuffer expanded;
if (*name=='-')
name=expanded.append("eclcc").append(name).str();
if (!value)
{
StringAttr s(name, len-1);
wu->setDebugValueInt(s.get(), last == '+' ? 1 : 0, true);
size_t len = strlen(name);
char last = name[len-1];
if (last == '-' || last == '+')
{
StringAttr s(name, len-1);
wu->setDebugValueInt(s.get(), last == '+' ? 1 : 0, true);
}
else
wu->setDebugValueInt(name, 1, true);
continue;
}
else
wu->setDebugValueInt(name, 1, true);
continue;
wu->setDebugValue(name, value, true);
}
wu->setDebugValue(name, value, true);
}
}

if (applications)
{
ForEachItemIn(ii, *applications)
if (applications)
{
IConstApplicationValue& item = applications->item(ii);
if(notEmpty(item.getApplication()) && notEmpty(item.getName()))
wu->setApplicationValue(item.getApplication(), item.getName(), item.getValue(), true);
ForEachItemIn(ii, *applications)
{
IConstApplicationValue& item = applications->item(ii);
if(notEmpty(item.getApplication()) && notEmpty(item.getName()))
wu->setApplicationValue(item.getApplication(), item.getName(), item.getValue(), true);
}
}
}

ISpan * activeSpan = context.queryActiveSpan();
OwnedSpanScope clientSpan(activeSpan->createClientSpan("run_workunit"));
Owned<IProperties> httpHeaders = ::getClientHeaders(clientSpan);
recordTraceDebugOptions(wu, httpHeaders);
ISpan * activeSpan = context.queryActiveSpan();
OwnedSpanScope clientSpan(activeSpan->createClientSpan("run_workunit"));
Owned<IProperties> httpHeaders = ::getClientHeaders(clientSpan);
recordTraceDebugOptions(wu, httpHeaders);

if (resetWorkflow)
wu->resetWorkflow();
if (!compile)
wu->schedule();
if (resetWorkflow)
wu->resetWorkflow();
if (!compile)
wu->schedule();

if (resetVariables)
{
SCMStringBuffer varname;
Owned<IConstWUResultIterator> vars = &wu->getVariables();
ForEach (*vars)
if (resetVariables)
{
vars->query().getResultName(varname);
Owned<IWUResult> v = wu->updateVariableByName(varname.str());
if (v)
v->setResultStatus(ResultStatusUndefined);
SCMStringBuffer varname;
Owned<IConstWUResultIterator> vars = &wu->getVariables();
ForEach (*vars)
{
vars->query().getResultName(varname);
Owned<IWUResult> v = wu->updateVariableByName(varname.str());
if (v)
v->setResultStatus(ResultStatusUndefined);
}
}
}

setXmlParameters(wu, paramXml, variables, (wu->getAction()==WUActionExecuteExisting));
setXmlParameters(wu, paramXml, variables, (wu->getAction()==WUActionExecuteExisting));
wu->commit();
}
catch (IException * e)
{
//An exception occurred when setting up the workunit e.g. an invalid debug value name.
wu->setState(WUStateFailed);
StringBuffer msg;
addExceptionToWorkunit(wu, SeverityError, "esp", e->errorCode(), e->errorMessage(msg).str(), nullptr, 0, 0, 0);
wu->commit();
throw;
}

wu->commit();
wu.clear();

if (!compile)
Expand Down
2 changes: 1 addition & 1 deletion esp/src/eclwatch/templates/GetDFUWorkunitsWidget.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="${baseClass}">
<div id="${id}BorderContainer" class="${baseClass}BorderContainer" style="width: 100%; height: 100%;" data-dojo-type="dijit.layout.BorderContainer">
<div id="${id}TabContainer" data-dojo-props="region: 'center', tabPosition: 'top'" style="width: 100%; height: 100%" data-dojo-type="dijit.layout.TabContainer">
<div id="${id}_Workunits" style="width: 100%; height: 100%" data-dojo-props='title:"Workunits"' data-dojo-type="dijit.layout.BorderContainer">
<div id="${id}_Workunits" style="width: 100%; height: 100%" data-dojo-props='title:"${i18n.title_GetDFUWorkunits}"' data-dojo-type="dijit.layout.BorderContainer">
<div id="${id}Toolbar" class="topPanel" data-dojo-props="region: 'top'" data-dojo-type="dijit.Toolbar">
<div id="${id}Refresh" data-dojo-attach-event="onClick:_onRefresh" data-dojo-props="iconClass:'iconRefresh'" data-dojo-type="dijit.form.Button">${i18n.Refresh}</div>
<span data-dojo-type="dijit.ToolbarSeparator"></span>
Expand Down
2 changes: 1 addition & 1 deletion esp/src/eclwatch/templates/HPCCPlatformFilesWidget.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</div>
<div id="${id}_LandingZones" title="${i18n.LandingZones}" data-dojo-props="delayWidget: 'LZBrowseWidget'" data-dojo-type="DelayLoadWidget">
</div>
<div id="${id}_Workunits" title="${i18n.Workunits}" data-dojo-props="delayWidget: 'GetDFUWorkunitsWidget'" data-dojo-type="DelayLoadWidget">
<div id="${id}_Workunits" title="${i18n.title_GetDFUWorkunits}" data-dojo-props="delayWidget: 'GetDFUWorkunitsWidget'" data-dojo-type="DelayLoadWidget">
</div>
<div id="${id}_Xref" title="${i18n.XRef}" data-dojo-props="delayWidget: 'XrefQueryWidget'" data-dojo-type="DelayLoadWidget">
</div>
Expand Down
27 changes: 11 additions & 16 deletions esp/src/src-react/components/InfoGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { formatCost, formatTwoDigits } from "src/Session";
import nlsHPCC from "src/nlsHPCC";
import { useWorkunitExceptions } from "../hooks/workunit";
import { FluentGrid, useCopyButtons, useFluentStoreState, FluentColumns } from "./controls/Grid";
import { pivotItemStyle } from "../layouts/pivot";

function extractGraphInfo(msg) {
const regex = /^([a-zA-Z0-9 :]+: )(graph graph(\d+)\[(\d+)\], )(([a-zA-Z]+)\[(\d+)\]: )?(.*)$/gmi;
Expand Down Expand Up @@ -237,23 +236,19 @@ export const InfoGrid: React.FunctionComponent<InfoGridProps> = ({
}
}, [data.length]);

return <div style={{ height: "100%", overflowY: "hidden" }}>
return <div style={{ height: "100%" }}>
<CommandBar items={buttons} farItems={copyButtons} />
<SizeMe monitorHeight >{({ size }) =>
<div style={{ height: "100%", overflowY: "hidden" }}>
<div style={{ ...pivotItemStyle(size), overflowY: "hidden" }}>
<FluentGrid
data={data}
primaryID={"id"}
columns={columns}
setSelection={_ => { }}
setTotal={setTotal}
refresh={refreshTable}
height={`${size.height - (44 + 8 + 45 + 12)}px`}
selectionMode={SelectionMode.none}
></FluentGrid>
</div>
</div>
<FluentGrid
data={data}
primaryID={"id"}
columns={columns}
setSelection={_ => { }}
setTotal={setTotal}
refresh={refreshTable}
height={`${size.height - (44 + 8 + 45 + 12)}px`}
selectionMode={SelectionMode.none}
></FluentGrid>
}</SizeMe>
</div>;
};
19 changes: 11 additions & 8 deletions esp/src/src-react/components/LogViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,16 @@ export const LogViewer: React.FunctionComponent<LogViewerProps> = ({
return <HolyGrail
header={<CommandBar items={buttons} farItems={copyButtons} />}
main={
<FluentGrid
data={data}
primaryID={"dateTime"}
columns={columns}
setSelection={setSelection}
setTotal={setTotal}
refresh={refreshTable}
></FluentGrid>}
<div style={{ position: "relative", height: "100%" }}>
<FluentGrid
data={data}
primaryID={"dateTime"}
columns={columns}
setSelection={setSelection}
setTotal={setTotal}
refresh={refreshTable}
></FluentGrid>
</div>
}
/>;
};
Loading

0 comments on commit 1a7e141

Please sign in to comment.