Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pdeathsigger #931

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

add pdeathsigger #931

wants to merge 3 commits into from

Conversation

slicklash
Copy link
Contributor

Problem

Sometimes gprofilter hangs

Causes

sometimes start_process (Popen) hangs because of preexec_fn

Caution

The preexec_fn parameter is NOT SAFE to use in the presence of threads in your application. The child process could deadlock before exec is called. https://docs.python.org/3/library/subprocess.html#popen-constructor

Solution

replace preexec_fn with start_new_session flag and introduce pdeathsigger

tests/utils.py Outdated
last_snapshot = profiler.snapshot()
return pid in last_snapshot

wait_event(timeout=5, stop_event=Event(), condition=has_profile, interval=0.1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this will try to snapshot() every 100ms? I don't think we can do snapshots that fast, it is a very heavy operation. If the issue is that pids do not appear fast enough in snapshots (what is the underlying reason 🤔 ? I see it's independent of runtime) then I'd be more comfortable sticking a sleep(2) before profiler.snapshot() instead of calling snapshot multiple times in a row.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants