Giter Site home page Giter Site logo

Comments (4)

zdyj3170101136 avatar zdyj3170101136 commented on June 1, 2024

and how should i verify that the Profiler work well with gevent?

could you please provide a small demo?

from dd-trace-py.

P403n1x87 avatar P403n1x87 commented on June 1, 2024

Yes, when using any of the features of ddtrace, it is recommended that ddtrace.auto is imported as the very first thing when not using the ddtrace-run command, and especially when using gevent.

We have an example for the compatibility between ddtrace and gevent in our test suite that is specific to profiling https://github.com/Datadog/dd-trace-py/blob/aa32be7a6d17917199a7da041bb86f62310c7971/tests/profiling/simple_program_gevent.py. The typical sign of issues that can arise when not importing ddtrace.auto at the right time is the timeout of gevent workers, and/or SSL-related issues in network-based applications.

from dd-trace-py.

zdyj3170101136 avatar zdyj3170101136 commented on June 1, 2024

from the gevent patch commit a665ffe#diff-35c795a5729666c71a99bc5dabeb4c30cb20608695d22719b73c0fd6701cb338

i saw it most do three things:

  • let forksafe run correctly with gevent
  • get correct thread name.
  • let lock work well both with gevent and threading.

i wonder why we need a lock that prevent concurrency from a gevent coroutine and from a threading.Thread at the same time?
see a665ffe#diff-35c795a5729666c71a99bc5dabeb4c30cb20608695d22719b73c0fd6701cb338L84

from dd-trace-py.

P403n1x87 avatar P403n1x87 commented on June 1, 2024

i wonder why we need a lock that prevent concurrency from a gevent coroutine and from a threading.Thread at the same time?

The linked commit is where the DoubleLock class (which I think is the locking mechanism described in the question) was removed, and that's because we no longer need this double locking with the current approach for the gevent support.

from dd-trace-py.

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.