You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/01/07 17:50:33 UTC

[GitHub] [skywalking] jsankalp edited a comment on issue #5653: http async client does not create span

jsankalp edited a comment on issue #5653:
URL: https://github.com/apache/skywalking/issues/5653#issuecomment-756273133


   Went through the issue and it seems that when we use a static httpclient the connections are reused from the pool. 
   
   So the instrumentation code never goes beyond `line no 439` as it finds a free connection from the pool and reuses it. [Code for checking free connections](https://hc.apache.org/httpcomponents-core-ga/httpcore-nio/xref/org/apache/http/nio/pool/AbstractNIOConnPool.html#L439)
   
   The instrumentation code relies on a new `SessionRequestImpl` instance creation being intercepted from `SessionRequestConstructorInterceptor` which is never reached in case of static httpclient and the trace breaks.
   [Making a new connection](https://hc.apache.org/httpcomponents-core-ga/httpcore-nio/xref/org/apache/http/nio/pool/AbstractNIOConnPool.html#L481)
   
   What would be a good way to fix this because as per my understanding the assumption that a new `SessionRequestImpl` will be created for every request is erroneous and making httpclient static is actually the right way to use it.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org