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

fix(profiling): Start profiler thread lazily #1903

Merged
merged 30 commits into from
Feb 22, 2023

Conversation

Zylphrex
Copy link
Member

When running with uWSGI, it preforks the process so the profiler thread is started on the master process but doesn't run on the worker process. This means that no samples are ever taken. This change delays the start of the profiler thread to the first profile that is started.

@Zylphrex Zylphrex changed the base branch from master to txiao/tests/add-workflow-to-test-gevent February 17, 2023 17:51
When running with uWSGI, it preforks the process so the profiler thread is
started on the master process but doesn't run on the worker process. This means
that no samples are ever taken. This change delays the start of the profiler
thread to the first profile that is started.
@Zylphrex Zylphrex force-pushed the txiao/fix/start-profiler-thread-lazily branch from 1acca19 to 9fb3ace Compare February 17, 2023 17:52
Base automatically changed from txiao/tests/add-workflow-to-test-gevent to master February 21, 2023 14:46
self.pid = pid
self.running = True

self.thread = self.make_thread()
Copy link
Member

Choose a reason for hiding this comment

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

Why can ThreadPool(1) not be called here directly?

@Zylphrex Zylphrex merged commit 2d24560 into master Feb 22, 2023
@Zylphrex Zylphrex deleted the txiao/fix/start-profiler-thread-lazily branch February 22, 2023 15:57
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.

None yet

2 participants