Code Monkey home page Code Monkey logo

Comments (5)

blopker avatar blopker commented on July 1, 2024

Does raising the sampling frequency to say, 5, remove the issue?

from djdt-flamegraph.

mgedmin avatar mgedmin commented on July 1, 2024

I haven't actually tried that.

Background: I was trying to figure out why precisely django-pipeline caused an 800ms delay in my template render, and I hacked the django-pipeline source to do the subprocess invocation in the main thread instead of using concurrent.futures.ThreadPoolExecutor. That's when I stumbled upon this problem. It's a classical race condition: sometimes clone() finishes before the next SIGALRM arrives, and so I was able to see the flame graph I was interested in after a few retries (that required me to kill and restart the livelocked django server).

This issue is not causing me pain, since I reverted the debugging change to django-pipeline once I was done investigating. I only filed a bug because I thought the problem analysis might be useful to anyone else who happens to encounter this issue.

I expect raising the sampling interval to 5 ms would make this problem harder to hit, but not remove the underlying issue.

from djdt-flamegraph.

mgedmin avatar mgedmin commented on July 1, 2024

Apparently you can ask that signals not interrupt system calls with signal.siginterrupt(sig, False).

Source: https://news.ycombinator.com/item?id=9243855

from djdt-flamegraph.

blopker avatar blopker commented on July 1, 2024

Ah, cool thank you. Does it work for you?

Sorry about the lack of updates. It has been working for us and I've been really busy lately. I still have this on my TODO though 😄

from djdt-flamegraph.

mgedmin avatar mgedmin commented on July 1, 2024

I haven't had a chance to try it out yet.

(Also, oops, I see I promised some smaller PRs doing something about the sampling inaccuracies I mentioned in #1, and I haven't delivered yet. Been busy too :/ What's worse -- I completely forgot the ball was in my court!)

from djdt-flamegraph.

Related Issues (7)

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.