Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/candidate-9.4.x'
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Halliday <[email protected]>

# Conflicts:
#	helm/hpcc/Chart.yaml
#	helm/hpcc/templates/_helpers.tpl
#	helm/hpcc/templates/dafilesrv.yaml
#	helm/hpcc/templates/dali.yaml
#	helm/hpcc/templates/dfuserver.yaml
#	helm/hpcc/templates/eclagent.yaml
#	helm/hpcc/templates/eclccserver.yaml
#	helm/hpcc/templates/eclscheduler.yaml
#	helm/hpcc/templates/esp.yaml
#	helm/hpcc/templates/localroxie.yaml
#	helm/hpcc/templates/roxie.yaml
#	helm/hpcc/templates/sasha.yaml
#	helm/hpcc/templates/thor.yaml
#	version.cmake
  • Loading branch information
ghalliday committed Mar 8, 2024
2 parents 16f61e0 + 06c9b61 commit e30bb31
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 19 deletions.
3 changes: 3 additions & 0 deletions ecl/hql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)

#Compiler complains about an unused function yyunput, and make sure that any warnings are not reported as errors
set_source_files_properties (hqllex.cpp PROPERTIES COMPILE_FLAGS " -Wno-unused-function -Wno-error")

#Compiler complains about a variable is set but not used
set_source_files_properties (hqlgram.cpp PROPERTIES COMPILE_FLAGS " -Wno-error=unused-but-set-variable -Wno-error=class-memaccess")
endif()

if (WIN32)
Expand Down
4 changes: 2 additions & 2 deletions ecl/hql/hqlexpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1146,8 +1146,8 @@ void HqlParseContext::finishMeta(bool isSeparateFile, bool success, bool generat
{
#if 0
IPropertyTree* tos = curMeta().meta;
# This is disabled as the location of the cache file needs to be
# in the original location for now. This may re-visited in the future.
// This is disabled as the location of the cache file needs to be
// in the original location for now. This may re-visited in the future.
if (isSeparateFile && hasCacheLocation())
{
StringBuffer fullName;
Expand Down
4 changes: 4 additions & 0 deletions ecl/hqlcpp/hqlresource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5549,15 +5549,19 @@ void EclResourcer::removeDuplicateIndependentLinks(CSplitterInfo & connections,
ResourcerInfo & sinkInfo = *queryResourceInfo(sink);
if (allInputsPulledIndependently(sink))
{
#ifdef TRACE_BALANCED
unsigned numRemoved = 0;
#endif
for (unsigned j=info.balancedLinks.ordinality()-1; j > i; j--)
{
CSplitterLink & next = info.balancedLinks.item(j);
if (next.hasSource(expr) && next.hasSink(sink))
{
info.balancedLinks.remove(j);
sinkInfo.balancedLinks.zap(next);
#ifdef TRACE_BALANCED
numRemoved++;
#endif
}
}

Expand Down
2 changes: 0 additions & 2 deletions roxie/ccd/ccdqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,6 @@ class RoxieQueue : public CInterface, implements IThreadFactory

bool remove(RoxiePacketHeader &x)
{
unsigned scanLength = 0;
ISerializedRoxieQueryPacket *found = nullptr;
{
CriticalBlock qc(qcrit);
Expand All @@ -1273,7 +1272,6 @@ class RoxieQueue : public CInterface, implements IThreadFactory
ISerializedRoxieQueryPacket *queued = waiting.item(i);
if (queued)
{
scanLength++;
if (queued->queryHeader().matchPacket(x))
{
waiting.set(i, NULL);
Expand Down
2 changes: 0 additions & 2 deletions system/jlib/jdebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3286,7 +3286,6 @@ void printProcMap(const char *fn, bool printbody, bool printsummary, StringBuffe
}
while (reader.nextln()) {
const char *ln = reader.ln;
unsigned n=0;
if (*ln) {
offset_t start = readHexNum(ln);
if (last&&(last!=start)) {
Expand Down Expand Up @@ -3360,7 +3359,6 @@ void printProcMap(const char *fn, bool printbody, bool printsummary, StringBuffe
recs[t].total += ssz;
if (ssz>recs[t].largest)
recs[t].largest = ssz;
n++;
last = end;
#ifndef __64BIT__
if ((end<0xffffffff)&&(end>=0xc0000000)) // rest is OS (32-bit only)
Expand Down
45 changes: 34 additions & 11 deletions testing/unittests/jlibtests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class JlibTraceTest : public CppUnit::TestFixture
CPPUNIT_TEST(testEnsureTraceID);
CPPUNIT_TEST(manualTestsEventsOutput);
CPPUNIT_TEST(manualTestsDeclaredFailures);
CPPUNIT_TEST(manualTestScopeEnd);

//CPPUNIT_TEST(testJTraceJLOGExporterprintResources);
//CPPUNIT_TEST(testJTraceJLOGExporterprintAttributes);
Expand Down Expand Up @@ -196,7 +197,7 @@ class JlibTraceTest : public CppUnit::TestFixture
{
Owned<IProperties> emptyMockHTTPHeaders = createProperties();
{
Owned<ISpan> serverSpan = queryTraceManager().createServerSpan("spanWithEventsNoAtts", emptyMockHTTPHeaders);
OwnedSpanScope serverSpan = queryTraceManager().createServerSpan("spanWithEventsNoAtts", emptyMockHTTPHeaders);
Owned<IProperties> emptyEventAtts = createProperties();
serverSpan->addSpanEvent("event1", emptyEventAtts);
}
Expand All @@ -206,12 +207,12 @@ class JlibTraceTest : public CppUnit::TestFixture
twoEventAtt->setProp("key2", "");

{
Owned<ISpan> serverSpan = queryTraceManager().createServerSpan("spanWithEvent1Att", emptyMockHTTPHeaders);
OwnedSpanScope serverSpan = queryTraceManager().createServerSpan("spanWithEvent1Att", emptyMockHTTPHeaders);
serverSpan->addSpanEvent("event2", twoEventAtt);
}//{ "type": "span", "name": "spanWithEvents1Att", "trace_id": "3b9f55aaf8fab51fb0d73a32db7d704f", "span_id": "2a25a44ae0b3abe0", "start": 1709696036335278770, "duration": 3363911469, "events":[ { "name": "event2", "time_stamp": 1709696038413023245, "attributes": {"key": "value" } } ] }

{
Owned<ISpan> serverSpan = queryTraceManager().createServerSpan("spanWith2Events", emptyMockHTTPHeaders);
OwnedSpanScope serverSpan = queryTraceManager().createServerSpan("spanWith2Events", emptyMockHTTPHeaders);
serverSpan->addSpanEvent("event1", twoEventAtt);
serverSpan->addSpanEvent("event2", twoEventAtt);
}//{ "type": "span", "name": "spanWith2Events", "trace_id": "ff5c5919b9c5f85913652b77f289bf0b", "span_id": "82f91ca1f9d469c1", "start": 1709698012480805016, "duration": 2811601377, "events":[ { "name": "event1", "time_stamp": 1709698013294323139, "attributes": {"key": "value" } },{ "name": "event2", "time_stamp": 1709698014500350802, "attributes": {"key": "value" } } ] }
Expand Down Expand Up @@ -275,48 +276,48 @@ class JlibTraceTest : public CppUnit::TestFixture
{
Owned<IProperties> emptyMockHTTPHeaders = createProperties();
{
Owned<ISpan> serverSpan = queryTraceManager().createServerSpan("defaultErrorSpan", emptyMockHTTPHeaders);
OwnedSpanScope serverSpan = queryTraceManager().createServerSpan("defaultErrorSpan", emptyMockHTTPHeaders);
serverSpan->recordError();
}//{ "type": "span", "name": "defaultErrorSpan", "trace_id": "209b5d8cea0aec9785d2dfa3117e37ad", "span_id": "ab72e76c2f2466c2", "start": 1709675278129335702, "duration": 188292867932, "status": "Error", "kind": "Server", "instrumented_library": "unittests", "events":[ { "name": "Exception", "time_stamp": 1709675465508149013, "attributes": {"escaped": 0 } } ] }

{
Owned<ISpan> serverSpan = queryTraceManager().createServerSpan("defaultErrorSpanStruct", emptyMockHTTPHeaders);
OwnedSpanScope serverSpan = queryTraceManager().createServerSpan("defaultErrorSpanStruct", emptyMockHTTPHeaders);
SpanError error;
serverSpan->recordError(error);
}//{ "type": "span", "name": "defaultErrorSpanStruct", "trace_id": "19803a446b971f2e0bdddc9c00db50fe", "span_id": "04c93a91ab8785a2", "start": 1709675487767044352, "duration": 2287497219, "status": "Error", "kind": "Server", "instrumented_library": "unittests", "events":[ { "name": "Exception", "time_stamp": 1709675489216412154, "attributes": {"escaped": 0 } } ] }

{
Owned<ISpan> serverSpan = queryTraceManager().createServerSpan("failedErrorSpanEscaped", emptyMockHTTPHeaders);
OwnedSpanScope serverSpan = queryTraceManager().createServerSpan("failedErrorSpanEscaped", emptyMockHTTPHeaders);
SpanError * error = new SpanError("hello");
error->setSpanStatus(true, true);
serverSpan->recordError(*error);
}//{ "type": "span", "name": "failedErrorSpanEscaped", "trace_id": "634f386c18a6140544c980e0d5a15905", "span_id": "e2f59c48f63a8f82", "start": 1709675508231168974, "duration": 7731717678, "status": "Error", "kind": "Server", "description": "hello", "instrumented_library": "unittests", "events":[ { "name": "Exception", "time_stamp": 1709675512164430668, "attributes": {"escaped": 1,"message": "hello" } } ] }

{
Owned<ISpan> serverSpan = queryTraceManager().createServerSpan("failedErrEscapedMsgErrCode", emptyMockHTTPHeaders);
OwnedSpanScope serverSpan = queryTraceManager().createServerSpan("failedErrEscapedMsgErrCode", emptyMockHTTPHeaders);
SpanError * error = new SpanError();
error->setSpanStatus(true, true);
error->setError("hello", 34);
serverSpan->recordError(*error);
}//failedErrEscapedMsgErrCode

{
Owned<ISpan> serverSpan = queryTraceManager().createServerSpan("containsErrorAndMessageSpan", emptyMockHTTPHeaders);
OwnedSpanScope serverSpan = queryTraceManager().createServerSpan("containsErrorAndMessageSpan", emptyMockHTTPHeaders);
serverSpan->recordError(SpanError("Error Message!!"));
}//{ "type": "span", "name": "containsErrorAndMessageSpan", "trace_id": "9a6e00ea309bc0427733f9b2d452f9e2", "span_id": "de63e9c69b64e411", "start": 1709675552302360510, "duration": 5233037523, "status": "Error", "kind": "Server", "description": "Error Message!!", "instrumented_library": "unittests", "events":[ { "name": "Exception", "time_stamp": 1709675555149852711, "attributes": {"escaped": 0,"message": "Error Message!!" } }

{
Owned<ISpan> serverSpan = queryTraceManager().createServerSpan("containsErrorAndMessageFailedNotEscapedSpan", emptyMockHTTPHeaders);
OwnedSpanScope serverSpan = queryTraceManager().createServerSpan("containsErrorAndMessageFailedNotEscapedSpan", emptyMockHTTPHeaders);
serverSpan->recordError(SpanError("Error Message!!", 23, true, false));
}//{ "type": "span", "name": "containsErrorAndMessageFailedNotEscapedSpan", "trace_id": "02f4b2d215f8230b15063862f8a91e41", "span_id": "c665ec371d6db147", "start": 1709675573581678954, "duration": 3467489486, "status": "Error", "kind": "Server", "description": "Error Message!!", "instrumented_library": "unittests", "events":[ { "name": "Exception", "time_stamp": 1709675576145074240, "attributes": {"code": 23,"escaped": 0,"message": "Error Message!!" } } ] }

{
Owned<ISpan> serverSpan = queryTraceManager().createServerSpan("mockExceptionSpanNotFailedNotEscaped", emptyMockHTTPHeaders);
OwnedSpanScope serverSpan = queryTraceManager().createServerSpan("mockExceptionSpanNotFailedNotEscaped", emptyMockHTTPHeaders);
serverSpan->recordException( makeStringExceptionV(76,"Mock exception"), false, false);
}//{ "type": "span", "name": "mockExceptionSpanNotFailedNotEscaped", "trace_id": "e01766474db05ce9085943fa3955cd73", "span_id": "7da620e96e10e42c", "start": 1709675595987480704, "duration": 2609091267, "status": "Unset", "kind": "Server", "instrumented_library": "unittests", "events":[ { "name": "Exception", "time_stamp": 1709675597728975355, "attributes": {"code": 76,"escaped": 0,"message": "Mock exception" } } ]

{
Owned<ISpan> serverSpan = queryTraceManager().createServerSpan("thrownExceptionSpan", emptyMockHTTPHeaders);
OwnedSpanScope serverSpan = queryTraceManager().createServerSpan("thrownExceptionSpan", emptyMockHTTPHeaders);
try
{
throw makeStringExceptionV( 356, "Mock thrown exception");
Expand All @@ -328,6 +329,28 @@ class JlibTraceTest : public CppUnit::TestFixture
}
}//{ "type": "span", "name": "thrownExceptionSpan", "trace_id": "4d6225e1cefdc6823d1134c71c522426", "span_id": "07f7bd070e008f53", "start": 1709675614823881961, "duration": 4665288686, "status": "Unset", "kind": "Server", "instrumented_library": "unittests", "events":[ { "name": "Exception", "time_stamp": 1709675616485586471, "attributes": {"code": 356,"escaped": 1,"message": "Mock thrown exception" } } ] }
}
//not able to programmatically test yet, but can visually inspect trace output
void manualTestScopeEnd()
{
Owned<ISpan> savedSpan;
{
SpanFlags flags = SpanFlags::EnsureTraceId;
Owned<IProperties> emptyMockHTTPHeaders = createProperties();
OwnedSpanScope serverSpan = queryTraceManager().createServerSpan("mySpan", emptyMockHTTPHeaders, flags);
DBGLOG("mySpan is alive");
savedSpan.set(serverSpan);
}//{ "type": "span", "name": "mySpan", "trace_id": "fe266416e7d588113a5131394d913ab4", "span_id": "7ac62328b04442c5", "start": 1709824793826023368, "duration": 16952 }
//NB: Duration for the span should be << 100,000,000ns
//If logging is asynchronous the log message may appear after the following logging line
DBGLOG("mySpan is finished");
Sleep(100);

//Check that the attributes are still accessible even though the span has ended
Owned<IProperties> retrievedSpanCtxAttributes = createProperties();
savedSpan->getSpanContext(retrievedSpanCtxAttributes.get());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected empty TraceID detected", false, isEmptyString(retrievedSpanCtxAttributes->queryProp("traceID")));
savedSpan.clear();
}

void testTraceDisableConfig()
{
Expand Down
2 changes: 0 additions & 2 deletions tools/hidl/hidlcomp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2254,10 +2254,8 @@ void ModuleInfo::write_body_class()
}
outf("}, %d };\n\n",version);

int fn=0;
for (ProcInfo *pi=procs; pi; pi=pi->next)
{
fn++;
pi->write_body_method_structs2(name);
}
outs("\n");
Expand Down

0 comments on commit e30bb31

Please sign in to comment.