Skip to content

fix(profiler): Stop nulling buffer on teardown#6075

Open
ericapisani wants to merge 1 commit intomasterfrom
ep/py-2140-profile-250
Open

fix(profiler): Stop nulling buffer on teardown#6075
ericapisani wants to merge 1 commit intomasterfrom
ep/py-2140-profile-250

Conversation

@ericapisani
Copy link
Copy Markdown
Member

@ericapisani ericapisani commented Apr 14, 2026

There's still the occasional race condition in the GEvent tests that may be related to fast "start/stop" cycles, and the teardown functions were not updated as part of #5622 (comment)

These changes remove self.buffer = None from teardown() in both ThreadContinuousScheduler and GeventContinuousScheduler in favour of using a local variable to assign self.buffer to before setting the local variable to None

Fixes PY-2140
Fixes #5673

Previously, teardown() set self.buffer = None which could cause
issues if the buffer was still being accessed. Keep the buffer
reference intact after teardown.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ericapisani ericapisani requested a review from a team as a code owner April 14, 2026 15:05
@linear-code
Copy link
Copy Markdown

linear-code bot commented Apr 14, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 14, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (ci) Cancel in-progress PR workflows on new commit push by joshuarli in #5994

Bug Fixes 🐛

  • (profiler) Stop nulling buffer on teardown by ericapisani in #6075

Internal Changes 🔧

  • (pydantic-ai) Remove dead Model.request patch by alexander-alderman-webb in #5956
  • Set explicit base-branch for codecov action by ericapisani in #5992

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 14, 2026

Codecov Results 📊

142 passed | Total: 142 | Pass Rate: 100% | Execution Time: 28.80s

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 14137 uncovered lines.

Files with missing lines (1)
File Patch % Lines
continuous_profiler.py 43.41% ⚠️ 176 Missing and 17 partials

Generated by Codecov Action

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.

Investigate potential race conditions in the teardown methods of the profilers

1 participant