|
@@ -951,7 +951,13 @@ public:
|
|
|
{
|
|
|
CriticalBlock cb(statecrit);
|
|
|
if (traceStartStop)
|
|
|
- DBGLOG("%p destroy state=%s", this, queryStateText(state)); // Note- CTXLOG may not be safe
|
|
|
+ {
|
|
|
+ DBGLOG("%p destroy %d state=%s", this, activityId, queryStateText(state)); // Note- CTXLOG may not be safe
|
|
|
+ if (watchActivityId && watchActivityId==activityId)
|
|
|
+ {
|
|
|
+ DBGLOG("WATCH: %p destroy %d state=%s", this, activityId, queryStateText(state)); // Note- CTXLOG may not be safe
|
|
|
+ }
|
|
|
+ }
|
|
|
if (state!=STATEreset)
|
|
|
{
|
|
|
DBGLOG("STATE: Activity %d destroyed but not reset", activityId);
|
|
@@ -1160,10 +1166,10 @@ public:
|
|
|
#ifdef TRACE_STARTSTOP
|
|
|
if (traceStartStop)
|
|
|
{
|
|
|
- CTXLOG("start %d", activityId);
|
|
|
+ CTXLOG("start %p %d", this, activityId);
|
|
|
if (watchActivityId && watchActivityId==activityId)
|
|
|
{
|
|
|
- CTXLOG("WATCH: start %d", activityId);
|
|
|
+ CTXLOG("WATCH: start %p %d", this, activityId);
|
|
|
}
|
|
|
}
|
|
|
#endif
|
|
@@ -1240,23 +1246,23 @@ public:
|
|
|
|
|
|
inline void stop(bool aborting)
|
|
|
{
|
|
|
+ // NOTE - don't be tempted to skip the stop for activities that are reset - splitters need to see the stops
|
|
|
if (state != STATEstopped)
|
|
|
{
|
|
|
CriticalBlock cb(statecrit);
|
|
|
if (state != STATEstopped)
|
|
|
{
|
|
|
- if (state != STATEreset)
|
|
|
- state=STATEstopped;
|
|
|
#ifdef TRACE_STARTSTOP
|
|
|
if (traceStartStop)
|
|
|
{
|
|
|
- CTXLOG("stop %d", activityId);
|
|
|
+ CTXLOG("stop %p %d (state currently %s)", this, activityId, queryStateText(state));
|
|
|
if (watchActivityId && watchActivityId==activityId)
|
|
|
{
|
|
|
- CTXLOG("WATCH: stop %d", activityId);
|
|
|
+ CTXLOG("WATCH: stop %p %d", this, activityId);
|
|
|
}
|
|
|
}
|
|
|
#endif
|
|
|
+ state=STATEstopped;
|
|
|
// NOTE - this is needed to ensure that dependencies which were not used are properly stopped
|
|
|
ForEachItemIn(idx, dependencies)
|
|
|
{
|
|
@@ -1298,10 +1304,10 @@ public:
|
|
|
#ifdef TRACE_STARTSTOP
|
|
|
if (traceStartStop)
|
|
|
{
|
|
|
- CTXLOG("reset %d", activityId);
|
|
|
+ CTXLOG("reset %p %d", this, activityId);
|
|
|
if (watchActivityId && watchActivityId==activityId)
|
|
|
{
|
|
|
- CTXLOG("WATCH: reset %d", activityId);
|
|
|
+ CTXLOG("WATCH: reset %p %d", this, activityId);
|
|
|
}
|
|
|
}
|
|
|
#endif
|
|
@@ -5968,12 +5974,17 @@ public:
|
|
|
graph->setResult(helper.querySequence(), result);
|
|
|
}
|
|
|
|
|
|
+ virtual const void *nextInGroup()
|
|
|
+ {
|
|
|
+ return input->nextInGroup(); // I can act as a passthrough input
|
|
|
+ }
|
|
|
+
|
|
|
IRoxieInput * querySelectOutput(unsigned id)
|
|
|
{
|
|
|
if (id == helper.querySequence())
|
|
|
{
|
|
|
- executed = true;
|
|
|
- return LINK(input);
|
|
|
+ executed = true; // Ensure that we don't try to pull as a sink as well as via the passthrough
|
|
|
+ return LINK(this);
|
|
|
}
|
|
|
return NULL;
|
|
|
}
|
|
@@ -6046,12 +6057,17 @@ public:
|
|
|
graph->setResult(helper.querySequence(), result);
|
|
|
}
|
|
|
|
|
|
+ virtual const void *nextInGroup()
|
|
|
+ {
|
|
|
+ return input->nextInGroup(); // I can act as a passthrough input
|
|
|
+ }
|
|
|
+
|
|
|
IRoxieInput * querySelectOutput(unsigned id)
|
|
|
{
|
|
|
if (id == helper.querySequence())
|
|
|
{
|
|
|
- executed = true;
|
|
|
- return LINK(input);
|
|
|
+ executed = true; // Ensure that we don't try to pull as a sink as well as via the passthrough
|
|
|
+ return LINK(this);
|
|
|
}
|
|
|
return NULL;
|
|
|
}
|
|
@@ -10914,10 +10930,15 @@ public:
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- outSeq->flush(&crc);
|
|
|
- updateWorkUnitResult(processed);
|
|
|
- uncompressedBytesWritten = outSeq->getPosition();
|
|
|
- writer->finish(true, this);
|
|
|
+ if (outSeq)
|
|
|
+ outSeq->flush(&crc);
|
|
|
+ if (outSeq)
|
|
|
+ uncompressedBytesWritten = outSeq->getPosition();
|
|
|
+ if (writer)
|
|
|
+ {
|
|
|
+ updateWorkUnitResult(processed);
|
|
|
+ writer->finish(true, this);
|
|
|
+ }
|
|
|
}
|
|
|
writer.clear();
|
|
|
CRoxieServerActivity::stop(aborting);
|
|
@@ -15341,7 +15362,12 @@ public:
|
|
|
{
|
|
|
CRoxieServerActivity::reset();
|
|
|
libraryGraph->reset();
|
|
|
- //Call reset on all unused outputs from the graph - no one else will.
|
|
|
+ //Call reset on all unused inputs/outputs from the graph - no one else will.
|
|
|
+ for (unsigned i1 = 0; i1 < numInputs; i1++)
|
|
|
+ {
|
|
|
+ if (!inputUsed[i1])
|
|
|
+ inputAdaptors[i1]->reset();
|
|
|
+ }
|
|
|
IRoxieServerChildGraph * graph = libraryGraph->queryLoopGraph();
|
|
|
ForEachItemIn(i3, extra.unusedOutputs)
|
|
|
{
|
|
@@ -19482,6 +19508,7 @@ public:
|
|
|
savedExtractSize = parentExtractSize;
|
|
|
savedExtract = parentExtract;
|
|
|
CRoxieServerActivity::start(parentExtractSize, parentExtract, paused);
|
|
|
+ executeDependencies(parentExtractSize, parentExtract, WhenBeforeId);
|
|
|
executeDependencies(parentExtractSize, parentExtract, WhenParallelId); // MORE: This should probably be done in parallel!
|
|
|
}
|
|
|
|
|
@@ -19545,6 +19572,7 @@ public:
|
|
|
savedExtractSize = parentExtractSize;
|
|
|
savedExtract = parentExtract;
|
|
|
CRoxieServerActionBaseActivity::start(parentExtractSize, parentExtract, paused);
|
|
|
+ executeDependencies(parentExtractSize, parentExtract, WhenBeforeId);
|
|
|
executeDependencies(parentExtractSize, parentExtract, WhenParallelId); // MORE: This should probably be done in parallel!
|
|
|
}
|
|
|
|