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-16823 - Library calls with unused inputs will core #9462

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions roxie/ccd/ccdserver.cpp
Expand Up @@ -15936,7 +15936,7 @@ class CRoxieServerLibraryCallActivity : public CRoxieServerActivity
if (inputUsed[i1])
inputAdaptors[i1]->setParentExtract(parentExtractSize, parentExtract);
else
inputAdaptors[i1]->stop();
inputAdaptors[i1]->queryInput()->stopall();
}

for (unsigned i2 = 0; i2 < numOutputs; i2++)
Expand All @@ -15948,7 +15948,7 @@ class CRoxieServerLibraryCallActivity : public CRoxieServerActivity
ForEachItemIn(i3, extra.unusedOutputs)
{
Owned<IFinalRoxieInput> output = graph->selectOutput(numInputs+extra.unusedOutputs.item(i3));
// output->queryStream().stop(); Is this needed??
output->stopall();
}
}
}
Expand All @@ -15964,7 +15964,7 @@ class CRoxieServerLibraryCallActivity : public CRoxieServerActivity
ForEachItemIn(i3, extra.unusedOutputs)
{
Owned<IFinalRoxieInput> output = graph->selectOutput(numInputs+extra.unusedOutputs.item(i3));
// Is this needed ?? output->queryStream().stop();
output->stopall();
}
CRoxieServerActivity::stop();
}
Expand Down
6 changes: 6 additions & 0 deletions roxie/ccd/ccdserver.hpp
Expand Up @@ -108,6 +108,12 @@ interface IFinalRoxieInput : extends IInputBase
virtual IIndexReadActivityInfo *queryIndexReadActivity() = 0;

virtual IStrandJunction *getOutputStreams(IRoxieSlaveContext *ctx, unsigned idx, PointerArrayOf<IEngineRowStream> &streams, const StrandOptions * consumerOptions, bool consumerOrdered, IOrderedCallbackCollection * orderedCallbacks) = 0; // Use StrandFlags values for flags

inline void stopall()
{
for (int i = 0; i < numConcreteOutputs(); i++)
queryConcreteOutputStream(i)->stop();
}
};

extern IEngineRowStream *connectSingleStream(IRoxieSlaveContext *ctx, IFinalRoxieInput *input, unsigned idx, Owned<IStrandJunction> &junction, bool consumerOrdered);
Expand Down
4 changes: 2 additions & 2 deletions testing/regress/ecl/aaalibrary2.ecl
Expand Up @@ -30,13 +30,13 @@ string10 forename;
integer2 age := 25;
END;

FilterDatasetInterface(dataset(namesRecord) ds, string search, boolean onlyOldies) := interface
FilterDatasetInterface(dataset(namesRecord) ds, dataset(namesRecord) unused, string search, boolean onlyOldies) := interface
export dataset(namesRecord) matches;
export dataset(namesRecord) others;
end;


filterDatasetLibrary(dataset(namesRecord) ds, string search, boolean onlyOldies) := module,library(FilterDatasetInterface)
filterDatasetLibrary(dataset(namesRecord) ds, dataset(namesRecord) unused, string search, boolean onlyOldies) := module,library(FilterDatasetInterface)
f := ds;
shared g := if (onlyOldies, f(age >= 65), f);
export matches := g(surname = search);
Expand Down
3 changes: 3 additions & 0 deletions testing/regress/ecl/key/library1.xml
Expand Up @@ -10,3 +10,6 @@
<Dataset name='OldNotHalliday'>
<Row><surname>Smith </surname><forename>George </forename><age>75</age></Row>
</Dataset>
<Dataset name='Result 4'>
<Row><surname>a </surname><forename>a </forename><age>2</age></Row>
</Dataset>
9 changes: 6 additions & 3 deletions testing/regress/ecl/library1.ecl
Expand Up @@ -26,21 +26,22 @@ integer2 age := 25;
END;


FilterDatasetInterface(dataset(namesRecord) ds, string search, boolean onlyOldies) := interface
FilterDatasetInterface(dataset(namesRecord) ds, dataset(namesRecord) unused, string search, boolean onlyOldies) := interface
export dataset(namesRecord) matches;
export dataset(namesRecord) others;
end;


FilterDatasetLibrary(dataset(namesRecord) ds, string search, boolean onlyOldies) := module,library(FilterDatasetInterface)
FilterDatasetLibrary(dataset(namesRecord) ds, dataset(namesRecord) unused, string search, boolean onlyOldies) := module,library(FilterDatasetInterface)
f := ds;
shared g := if (onlyOldies, f(age >= 65), f);
export matches := g(surname = search);
export others := g(surname != search);
end;

empty := nofold(DATASET([{'a','a',2}], namesRecord));

filterDataset(dataset(namesRecord) ds, string search, boolean onlyOldies) := library(internal(FilterDatasetLibrary), FilterDatasetInterface(ds, search, onlyOldies));
filterDataset(dataset(namesRecord) ds, string search, boolean onlyOldies) := library(internal(FilterDatasetLibrary), FilterDatasetInterface(ds, empty, search, onlyOldies));


namesTable := dataset([
Expand All @@ -58,3 +59,5 @@ output(filtered2.others,,named('NotHalliday'));

filtered3 := filterDataset(namesTable, 'Halliday', true);
output(filtered3.others,,named('OldNotHalliday'));

output(empty);
5 changes: 3 additions & 2 deletions testing/regress/ecl/library2.ecl
Expand Up @@ -27,13 +27,14 @@ string10 forename;
integer2 age := 25;
END;

FilterDatasetInterface(dataset(namesRecord) ds, string search, boolean onlyOldies) := interface
FilterDatasetInterface(dataset(namesRecord) ds, dataset(namesRecord) unused, string search, boolean onlyOldies) := interface
export dataset(namesRecord) matches;
export dataset(namesRecord) others;
end;

empty := DATASET([], namesRecord);

filterDataset(dataset(namesRecord) ds, string search, boolean onlyOldies) := library('aaaLibrary2',FilterDatasetInterface(ds,search,onlyOldies));
filterDataset(dataset(namesRecord) ds, string search, boolean onlyOldies) := library('aaaLibrary2',FilterDatasetInterface(ds,empty,search,onlyOldies));

namesTable := dataset([
{'Halliday','Gavin',31},
Expand Down
6 changes: 4 additions & 2 deletions testing/regress/ecl/library2a.ecl
Expand Up @@ -27,15 +27,17 @@ string10 forename;
integer2 age := 25;
END;

FilterDatasetInterface(dataset(namesRecord) ds, string search, boolean onlyOldies) := interface
FilterDatasetInterface(dataset(namesRecord) ds, dataset(namesRecord) unused, string search, boolean onlyOldies) := interface
export dataset(namesRecord) matches;
export dataset(namesRecord) others;
end;


boolean falseval := false: stored('yeahright');

filterDataset(dataset(namesRecord) ds, string search, boolean onlyOldies) := library('aaaLibrary2',FilterDatasetInterface(ds,search,onlyOldies));
empty := DATASET([], namesRecord);

filterDataset(dataset(namesRecord) ds, string search, boolean onlyOldies) := library('aaaLibrary2',FilterDatasetInterface(ds,empty,search,onlyOldies));

namesTable := dataset([
{'Halliday','Gavin',31},
Expand Down