Skip to content

Commit

Permalink
Code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmcmu committed Jan 10, 2025
1 parent 3b0458d commit a007e25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
13 changes: 2 additions & 11 deletions fs/dafilesrv/dafilesrv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ int main(int argc, const char* argv[])

EnableSEHtoExceptionMapping();
#ifndef __64BIT__

// Restrict stack sizes on 32-bit systems
Thread::setDefaultStackSize(0x10000); // 64K stack (also set in windows DSP)
#endif
Expand All @@ -396,16 +395,8 @@ int main(int argc, const char* argv[])
#endif

const char* componentTag = "dafilesrv";
Owned<IPropertyTree> componentDefault;
if (defaultYaml)
{
Owned<IPropertyTree> defaultConfig = createPTreeFromYAMLString(defaultYaml, 0, ptr_ignoreWhiteSpace, nullptr);
componentDefault.set(defaultConfig->queryPropTree(componentTag));
if (!componentDefault)
throw makeStringExceptionV(99, "Default configuration does not contain the tag %s", componentTag);
}
else
componentDefault.setown(createPTree(componentTag));
Owned<IPropertyTree> defaultConfig = createPTreeFromYAMLString(defaultYaml, 0, ptr_ignoreWhiteSpace, nullptr);
Owned<IPropertyTree> componentDefault(defaultConfig->queryPropTree(componentTag));

// NB: bare-metal dafilesrv does not have a component specific xml, extracting relevant global configuration instead
Owned<IPropertyTree> config = loadConfiguration(componentDefault, extractedGlobalConfig, argv, componentTag, "DAFILESRV", nullptr, nullptr);
Expand Down
13 changes: 6 additions & 7 deletions fs/dafsserver/dafsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1114,10 +1114,9 @@ class CRemoteRequest : public CSimpleInterfaceOf<IInterface>
const char* fullTraceContext = requestTree->queryProp("_trace/traceparent");

// We only want to compare the trace-id & span-id, so remove the last "sampling" group
const char* traceParent = fullTraceContext ? fullTraceContext : "";
traceParent = strrchr(traceParent, '-');

if (strlen(traceParent) != 0 && requestTraceParent != traceParent)
std::string traceParent = fullTraceContext;
traceParent = traceParent.substr(0, traceParent.find_last_of('-'));
if (!traceParent.empty() && requestTraceParent != traceParent)
{
// Check to see if we have an existing span that needs to be marked successful before close
if (requestSpan != nullptr)
Expand All @@ -1134,7 +1133,7 @@ class CRemoteRequest : public CSimpleInterfaceOf<IInterface>
else
requestSpanName = "WriteRequest";

requestSpan.set(queryTraceManager().createServerSpan(requestSpanName, traceHeaders));
requestSpan.setown(queryTraceManager().createServerSpan(requestSpanName, traceHeaders));
requestTraceParent = traceParent;
}

Expand Down Expand Up @@ -5008,7 +5007,7 @@ class CRemoteFileServer : implements IRemoteFileServer, public CInterface
Owned<IProperties> traceHeaders = createProperties();
traceHeaders->setProp("traceparent", traceParent);

closeSpan.set(queryTraceManager().createServerSpan("CloseRequest", traceHeaders));
closeSpan.setown(queryTraceManager().createServerSpan("CloseRequest", traceHeaders));
}

if (0 == cursorHandle)
Expand Down Expand Up @@ -5053,7 +5052,7 @@ class CRemoteFileServer : implements IRemoteFileServer, public CInterface
Owned<IProperties> traceHeaders = createProperties();
traceHeaders->setProp("traceparent", traceParent);

versionSpan.set(queryTraceManager().createServerSpan("VersionRequest", traceHeaders));
versionSpan.setown(queryTraceManager().createServerSpan("VersionRequest", traceHeaders));
}

if (outFmt_Binary == outputFormat)
Expand Down

0 comments on commit a007e25

Please sign in to comment.