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

Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>

# Conflicts:
#	helm/hpcc/Chart.yaml
#	helm/hpcc/templates/_helpers.tpl
#	version.cmake
  • Loading branch information
GordonSmith committed Sep 5, 2024
2 parents 40beee6 + 7430b92 commit e35ea3f
Show file tree
Hide file tree
Showing 50 changed files with 783 additions and 310 deletions.
2 changes: 2 additions & 0 deletions common/dllserver/thorplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,8 @@ const StringArray &HelperDll::queryManifestFiles(const char *type, const char *w
OwnedIFileIO o = f->open(IFOcreate);
assertex(o.get() != nullptr);
o->write(0, len, data);
o->close();

list->append(extractName);
if (doTrace(traceJava) && streq(type, "jar"))
DBGLOG("Extracted jar resource %u size %u to %s in %u ms", id, len, extractName.str(), msTick() - start);
Expand Down
2 changes: 2 additions & 0 deletions dali/base/dacoven.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,12 +563,14 @@ class CCovenServer: public CCovenBase
Owned<IFile> f = createIFile(storename.get());
Owned<IFileIO> io = f->open(IFOcreate);
io->write(0, xml.length(), xml.str());
io->close();
io.clear();
if (!backupname.isEmpty()) {
try {
f.setown(createIFile(backupname.get()));
io.setown(f->open(IFOcreate));
io->write(0, xml.length(), xml.str());
io->close();
io.clear();
}
catch (IException *e) {
Expand Down
4 changes: 4 additions & 0 deletions dali/base/dasds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,7 @@ void writeDelta(StringBuffer &xml, IFile &iFile, const char *msg="", unsigned re
sprintf(strNum, "%016" I64F "X", fLen);
memcpy(headerPtr + deltaHeaderSizeOff, strNum, 16);
iFileIO->write(0, strlen(deltaHeader), headerPtr);
iFileIO->close();
}
catch (IException *e)
{
Expand Down Expand Up @@ -1213,6 +1214,7 @@ class CDeltaWriter : implements IThreaded
Owned<IFile> iFile = createIFile(rL.str());
Owned<IFileIO> fileIO = iFile->open(IFOcreate);
fileIO->write(0, length, data);
fileIO->close();
}
catch (IException *e)
{
Expand Down Expand Up @@ -5287,6 +5289,7 @@ class CStoreHelper : implements IStoreHelper, public CInterface
iFileIO->write(0, sizeof(unsigned), crc);
if (storeInfo)
storeInfo->cache.set(filename.str());
iFileIO->close();
}

void updateStoreInfo(const char *base, const char *location, unsigned edition, unsigned *crc, CStoreInfo *storeInfo=NULL)
Expand Down Expand Up @@ -5398,6 +5401,7 @@ class CStoreHelper : implements IStoreHelper, public CInterface

OwnedIFileIO detachIPIO = detachIPIFile->open(IFOcreate);
detachIPIO->write(0, sizeof(storeHelper.mySessId), &storeHelper.mySessId);
detachIPIO->close();
detachIPIO.clear();
detachIPIFile->rename(activeDetachIPStr.str());
// check often do not wait any longer than necessary
Expand Down
2 changes: 1 addition & 1 deletion dali/datest/datest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2927,7 +2927,7 @@ NULL
#else
out = fileno(stdout);
#endif
Owned<IFileIO> stdOutFileIO = createIFileIO(out,IFOwrite);
Owned<IFileIO> stdOutFileIO = createIFileIO(nullptr,out,IFOwrite);
if (testParams.ordinality())
{
newFileName = testParams.item(0);
Expand Down
1 change: 1 addition & 0 deletions dali/ft/filecopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,7 @@ void FileSprayer::beforeTransfer()
io->write(lastOutputOffset-sizeof(null), sizeof(null), &null);
}
}
io->close();
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions dali/ft/ftbase.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ public:
virtual offset_t tell() override;
virtual size32_t write(size32_t len, const void * data) override;
virtual unsigned __int64 getStatistic(StatisticKind kind) override { return stream->getStatistic(kind); }
virtual void close() override
{
stream->close();
}

unsigned getCRC() { return crc; }
void setCRC(unsigned long _crc) { crc = _crc; }
Expand Down
9 changes: 9 additions & 0 deletions dali/ft/fttransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,8 @@ bool TransferServer::pull()
assertex(curProgress.status != OutputProgress::StatusRenamed);
if (curProgress.status != OutputProgress::StatusCopied)
{
if (out)
out->close();
out.setown(createIOStream(outio));
out->seek(progressOffset, IFSbegin);
wrapOutInCRC(curProgress.outputCRC);
Expand Down Expand Up @@ -885,6 +887,8 @@ bool TransferServer::pull()
}
}

if (out)
out->close();
out.setown(createIOStream(outio));
out->seek(0, IFSbegin);
wrapOutInCRC(0);
Expand All @@ -903,7 +907,10 @@ bool TransferServer::pull()
}

crcOut.clear();
if (out)
out->close();
out.clear();

//Once the transfers have completed, rename the files, and sync file times
//if replicating...
if (!isSafeMode)
Expand Down Expand Up @@ -997,6 +1004,7 @@ bool TransferServer::push()
}
outio.setown(createCompressedFileWriter(outio, false, 0, true, compressor, COMPRESS_METHOD_LZ4));
}

out.setown(createIOStream(outio));
if (!compressOutput)
out->seek(curPartition.outputOffset + curProgress.outputLength, IFSbegin);
Expand All @@ -1011,6 +1019,7 @@ bool TransferServer::push()
sendProgress(curProgress);
}
crcOut.clear();
out->close();
out.clear();
}
}
Expand Down
1 change: 1 addition & 0 deletions dali/server/daserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ int main(int argc, const char* argv[])
backupCheck.append("bakchk.").append((unsigned)GetCurrentProcessId());
OwnedIFile iFileDataDir = createIFile(backupCheck.str());
OwnedIFileIO iFileIO = iFileDataDir->open(IFOcreate);
iFileIO->close();
iFileIO.clear();
try
{
Expand Down
1 change: 1 addition & 0 deletions ecl/ecl-bundle/ecl-bundle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ class CBundleInfoSet : public CInterfaceOf<IBundleInfoSet>
VStringBuffer redirect("IMPORT %s.%s.%s.%s as _%s; EXPORT %s := _%s;", VERSION_SUBDIR, name, version, name, name, name, name);
Owned<IFileIO> rfile = redirector->open(IFOcreate);
rfile->write(0, redirect.length(), redirect.str());
rfile->close();
bundle->setActive(true);
}
virtual void setActive(const char *version)
Expand Down
10 changes: 8 additions & 2 deletions ecl/eclcc/eclcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1990,8 +1990,11 @@ void EclCC::outputXmlToOutputFile(EclCompileInstance & instance, IPropertyTree *
{
//Work around windows problem writing 64K to stdout if not redirected/piped
Owned<IIOStream> stream = createIOStream(ifileio.get());
Owned<IIOStream> buffered = createBufferedIOStream(stream,0x8000);
saveXML(*buffered, xml);
{
Owned<IIOStream> buffered = createBufferedIOStream(stream,0x8000);
saveXML(*buffered, xml);
}
ifileio->close();
}
}

Expand Down Expand Up @@ -2044,7 +2047,10 @@ void EclCC::generateOutput(EclCompileInstance & instance)

OwnedIFileIO ifileio = createArchiveOutputFile(instance);
if (ifileio)
{
ifileio->write(0, filenames.length(), filenames.str());
ifileio->close();
}
}
else
{
Expand Down
1 change: 1 addition & 0 deletions ecl/eclccserver/eclccserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ class EclccCompileThread : implements IPooledThread, implements IErrorReporter,
{
Owned<IFileIO> dstIO = dstfile->open(IFOwrite);
dstIO->write(0, output.length(), output.str());
dstIO->close();

IArrayOf<IError> errors;
extractErrorsFromCppLog(errors, output.str(), numFailed != 0);
Expand Down
3 changes: 3 additions & 0 deletions ecl/eclcmd/queries/ecl-queries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,10 @@ class EclCmdQueriesExport : public EclCmdCommon
fprintf(stdout, "\nWriting to file %s\n", file->queryFilename());

if (io.get())
{
io->write(0, strlen(s), s);
io->close();
}
else
fprintf(stderr, "\nFailed to create file %s\n", file->queryFilename());
}
Expand Down
1 change: 1 addition & 0 deletions ecl/hql/hqlcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ static void extractFile(const char * path, const char * moduleName, const char *
Owned<IFileIO> io = file->open(IFOcreate);
if (text)
io->write(0, strlen(text), text);
io->close();
io.clear();
if (ts)
{
Expand Down
4 changes: 2 additions & 2 deletions ecl/hqlcpp/hqlecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ void HqlDllGenerator::expandCode(StringBuffer & filename, const char * codeTempl
addDirectoryPrefix(fullname, targetDir).append(filename);

Owned<IFile> out = createIFile(fullname.str());
Owned<ITemplateExpander> expander = createTemplateExpander(out, codeTemplate);
Owned<ITemplateExpander> expander = createTemplateExpander(codeTemplate);

Owned<ISectionWriter> writer = createCppWriter(*code, compiler);
Owned<IProperties> props = createProperties(true);
Expand All @@ -324,7 +324,7 @@ void HqlDllGenerator::expandCode(StringBuffer & filename, const char * codeTempl
props->setProp("headerName", headerName.str());
props->setProp("outputName", fullname.str());

expander->generate(*writer, pass, props);
expander->generate(*writer, out, pass, props);

totalGeneratedSize += out->size();

Expand Down
17 changes: 11 additions & 6 deletions ecl/hqlcpp/hqlwcpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,14 @@ CppWriterTemplate::CppWriterTemplate(const char * codeTemplate)
loadTemplate(codeTemplate);
}

void CppWriterTemplate::generate(ISectionWriter & writer, unsigned pass, IProperties * properties)
void CppWriterTemplate::generate(ISectionWriter & writer, IFile * outputFile, unsigned pass, IProperties * properties)
{
writer.setOutput(out, outStream);
Owned<IFileIO> io = outputFile->open(IFOcreate);
if (!io)
throwError1(HQLERR_CouldNotCreateOutputX, outputFile->queryFilename());

outStream.setown(createIOStream(io));
writer.setOutput(outputFile, outStream);

const char * finger = text;
bool output = true;
Expand Down Expand Up @@ -149,6 +154,8 @@ void CppWriterTemplate::generate(ISectionWriter & writer, unsigned pass, IProper
outputQuoted(writer, end-finger, finger);

writer.setOutput(NULL, NULL);
outStream.clear();
io->close();
}

void CppWriterTemplate::loadTemplate(const char * codeTemplate)
Expand Down Expand Up @@ -2271,11 +2278,9 @@ void HqlCppSectionWriter::generateSection(unsigned delta, IAtom * section, unsig

//---------------------------------------------------------------------------

ITemplateExpander * createTemplateExpander(IFile * output, const char * codeTemplate)
ITemplateExpander * createTemplateExpander(const char * codeTemplate)
{
Owned<CppWriterTemplate> expander = new CppWriterTemplate(codeTemplate);
expander->setOutput(output);
return expander.getClear();
return new CppWriterTemplate(codeTemplate);
}

ISectionWriter * createCppWriter(IHqlCppInstance & _instance, CompilerType compiler)
Expand Down
4 changes: 2 additions & 2 deletions ecl/hqlcpp/hqlwcpp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ interface HQLCPP_API ISectionWriter : public IInterface
interface HQLCPP_API ITemplateExpander : public IInterface
{
public:
virtual void generate(ISectionWriter & writer, unsigned pass, IProperties * properties = NULL) = 0;
virtual void generate(ISectionWriter & writer, IFile * _output, unsigned pass, IProperties * properties = NULL) = 0;
};

extern HQLCPP_API StringBuffer & generateExprCpp(StringBuffer & out, IHqlExpression * expr, CompilerType compiler);
extern HQLCPP_API StringBuffer & generateTypeCpp(StringBuffer & out, ITypeInfo * type, const char * name, CompilerType compiler);
bool generateFunctionPrototype(StringBuffer & out, IHqlExpression * funcdef, CompilerType compiler);
void generateFunctionReturnType(StringBuffer & prefix, StringBuffer & params, ITypeInfo * retType, IHqlExpression * attrs, CompilerType compiler);

extern HQLCPP_API ITemplateExpander * createTemplateExpander(IFile * output, const char * codeTemplate);
extern HQLCPP_API ITemplateExpander * createTemplateExpander(const char * codeTemplate);
extern HQLCPP_API ISectionWriter * createCppWriter(IHqlCppInstance & _instance, CompilerType compiler);
extern bool isTypePassedByAddress(ITypeInfo * type);

Expand Down
14 changes: 1 addition & 13 deletions ecl/hqlcpp/hqlwcpp.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,14 @@ public:
CppWriterTemplate(const char * codeTemplate);
IMPLEMENT_IINTERFACE

virtual void generate(ISectionWriter & writer, unsigned pass, IProperties * properties = NULL);
virtual void generate(ISectionWriter & writer, IFile * _output, unsigned pass, IProperties * properties = NULL);

void outputQuoted(ISectionWriter & writer, size32_t len, const char * str)
{
writer.noteLines(memcount(len, str, '\n'));
outStream->write(len, str);
}

void setOutput(IFile * _output)
{
Owned<IFileIO> io = _output->open(IFOcreate);
if (!io)
throwError1(HQLERR_CouldNotCreateOutputX, _output->queryFilename());

out.set(_output);
outStream.setown(createIOStream(io));
}


private:
void loadTemplate(const char * codeTemplate);
enum TplSectionType { TplEmbed, TplExpand, TplCondition, TplEndCondition };
Expand All @@ -58,7 +47,6 @@ protected:
const char * text;
unsigned len;
CIArray sections;
Owned<IFile> out;
Owned<IIOStream> outStream;
};

Expand Down
2 changes: 2 additions & 0 deletions ecl/hthor/hthor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ void CHThorDiskWriteActivity::close()
{
io->flush();
numDiskWrites = io->getStatistic(StNumDiskWrites);
io->close();
io.clear();
}
if(clusterHandler)
Expand Down Expand Up @@ -1295,6 +1296,7 @@ void CHThorIndexWriteActivity::execute()
offsetBranches = builder->getOffsetBranches();
out->flush();
out.clear();
io->close();
}

if(clusterHandler)
Expand Down
2 changes: 1 addition & 1 deletion esp/bindings/SOAP/Platform/soapbind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ int CHttpSoapBinding::HandleSoapRequest(CHttpRequest* request, CHttpResponse* re
response->sendBasicChallenge(m_challenge_realm.str(), false);
else if (status == SOAP_AUTHENTICATION_ERROR)
{
throw MakeStringExceptionDirect(401,"Unauthorized Access");
throw makeStringExceptionV(401, "Unauthorized Access: %s - user=%s", ctx->queryServiceName(nullptr), nullText(ctx->queryUserId()));
}
else
response->setStatus(HTTP_STATUS_OK);
Expand Down
18 changes: 18 additions & 0 deletions esp/src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions esp/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"react-hook-form": "7.51.2",
"react-hot-toast": "2.4.1",
"react-reflex": "4.2.6",
"react-singleton-hook": "3.4.0",
"react-sizeme": "3.0.2",
"universal-router": "9.2.0",
"xstyle": "0.3.3"
Expand Down
4 changes: 3 additions & 1 deletion esp/src/src-react/components/Files.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ function formatQuery(_filter): { [id: string]: any } {
delete filter.NotInSuperFiles;
delete filter.Indexes;
if (filter.StartDate) {
if (filter.StartDate.indexOf("Z") < 0) { filter.StartDate += ":00.000Z"; }
filter.StartDate = new Date(filter.StartDate).toISOString();
}
if (filter.EndDate) {
filter.EndDate = new Date(filter.StartDate).toISOString();
if (filter.EndDate.indexOf("Z") < 0) { filter.EndDate += ":00.000Z"; }
filter.EndDate = new Date(filter.EndDate).toISOString();
}
return filter;
}
Expand Down
Loading

0 comments on commit e35ea3f

Please sign in to comment.