Skip to content

Commit

Permalink
Merge pull request #18522 from rpastrana/HPCC-31570-SoapCallSpanFix
Browse files Browse the repository at this point in the history
HPCC-31570 SoapCall to propagate client span headers

Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Apr 11, 2024
2 parents c32f5da + aa5bf04 commit b29ebe4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions common/thorhelper/thorsoapcall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ interface IWSCAsyncFor: public IInterface
virtual void processException(const Url &url, ConstPointerArray &inputRows, IException *e) = 0;
virtual void checkTimeLimitExceeded(unsigned * _remainingMS) = 0;

virtual void createHttpRequest(Url &url, StringBuffer &request) = 0;
virtual void createHttpRequest(StringBuffer &request, const Url &url, const IProperties * traceHeaders) = 0;
virtual int readHttpResponse(StringBuffer &response, ISocket *socket, bool &keepAlive, StringBuffer &contentType) = 0;
virtual void processResponse(Url &url, StringBuffer &response, ColumnProvider * meta, const char *contentType) = 0;

Expand Down Expand Up @@ -1958,7 +1958,7 @@ class CWSCAsyncFor : implements IWSCAsyncFor, public CInterface, public CAsyncFo
}
}

void createHttpRequest(Url &url, StringBuffer &request)
void createHttpRequest(StringBuffer &request, const Url &url, const IProperties * traceHeaders)
{
// Create the HTTP POST request
if (master->wscType == STsoap)
Expand Down Expand Up @@ -1992,7 +1992,6 @@ class CWSCAsyncFor : implements IWSCAsyncFor, public CInterface, public CAsyncFo
if (!httpHeaderBlockContainsHeader(httpheaders, ACCEPT_ENCODING))
request.appendf("%s: gzip, deflate\r\n", ACCEPT_ENCODING);
#endif
Owned<IProperties> traceHeaders = ::getClientHeaders(master->activitySpanScope);
if (traceHeaders)
{
Owned<IPropertyIterator> iter = traceHeaders->getIterator();
Expand Down Expand Up @@ -2454,7 +2453,6 @@ class CWSCAsyncFor : implements IWSCAsyncFor, public CInterface, public CAsyncFo
unsigned retryInterval = 0;

Url &url = master->urlArray.item(idx);
createHttpRequest(url, request);
unsigned startidx = idx;
while (!master->aborted)
{
Expand Down Expand Up @@ -2563,6 +2561,10 @@ class CWSCAsyncFor : implements IWSCAsyncFor, public CInterface, public CAsyncFo
checkRoxieAbortMonitor(master->roxieAbortMonitor);
OwnedSpanScope socketOperationSpan = master->activitySpanScope->createClientSpan("Socket Write");
setSpanURLAttributes(socketOperationSpan, url);

Owned<IProperties> traceHeaders = ::getClientHeaders(socketOperationSpan);
createHttpRequest(request, url, traceHeaders);

socket->write(request.str(), request.length());

if (soapTraceLevel > 4)
Expand Down

0 comments on commit b29ebe4

Please sign in to comment.