Git Product home page Git Product logo

Comments (4)

dsyer avatar dsyer commented on May 24, 2024

Why do you think it's a problem?

from spring-cloud-sleuth.

gauravrmazra avatar gauravrmazra commented on May 24, 2024

In TraceCallable and TraceRunnable, first span is started and we get TraceScope reference and run the delegated Thread(Runnable or Callable) and when it is done. We call close() of that particular scope, which does as mentioned in above question.
My concern is related to Executors. If one executor is shared to do some process and multiple requests are coming which is catered by some service using executors(It is just a use case). Then in worker threads of executors, the above code is creating problem and lead to Htrace error message when space is started. This is the reason I asking for this way. Isn't it if Worker thread is done its processing then it should clear its ThreadLocal context as well.

I will write some sample app with code which is able to reproduce this problem and with possible solution.

from spring-cloud-sleuth.

dsyer avatar dsyer commented on May 24, 2024

I'm not sure I see the problem yet, but a sample project will certainly help. BTW I'm in the middle of a big refactor of all the core APIs so the names and locations of things might change soon.

from spring-cloud-sleuth.

gauravrmazra avatar gauravrmazra commented on May 24, 2024

I have created the sampleapp
https://github.com/gauravrmazra/spring-cloud-sleuth-executor-sampleapp

If multiple request are send from UI, it throws weird Htrace error (runtime exception)

The solution is simple. Just remove the current span from ThreadLocal context of the worker thread within TraceCallable and TraceRunnable

from spring-cloud-sleuth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.