GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-91048: fix thread safety for asyncio stack introspection APIs by kumaraditya303 · Pull Request #129399 · python/cpython

Conversation

@kumaraditya303

@kumaraditya303 kumaraditya303 commented Jan 28, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Changes:

  • Add critical sections where required before calling impl function
  • Add critical section assertions
  • Move getters setters to be together with others
  • Elide away unnecessary type checks and align functions to take FutureObj * as all the other ones already do. In most cases, we avoid type checking on task which is guaranteed to be task or its subclass.
  • Issue: Async Call-Stack Reconstruction #91048

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kumaraditya303
fix thread safety
37e9a7d
@kumaraditya303 kumaraditya303 added topic-asyncio skip news labels Jan 28, 2025
@kumaraditya303
kumaraditya303 requested review from 1st1, asvetlov and willingc as code owners January 28, 2025 13:09
@bedevere-app bedevere-app Bot added the awaiting core review label Jan 28, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Jan 28, 2025
Async Call-Stack Reconstruction #91048
Closed
@kumaraditya303
kumaraditya303 requested review from ambv and pablogsal January 28, 2025 13:12
@kumaraditya303
Merge branch 'main' into tsafe
54bdc3b
@kumaraditya303

kumaraditya303 commented Feb 6, 2025

Copy link
Copy Markdown
Contributor Author

Merging this as its been sitting idle for over a week now.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kumaraditya303
kumaraditya303 merged commit 75c5519 into python:main Feb 6, 2025
@bedevere-app bedevere-app Bot removed the awaiting core review label Feb 6, 2025
@kumaraditya303
kumaraditya303 deleted the tsafe branch February 6, 2025 16:04
kumaraditya303
kumaraditya303 commented Feb 6, 2025
View reviewed changes
Comment thread Modules/_asynciomodule.c
if (TaskOrFuture_Check(state, fut) && TaskOrFuture_Check(state, waiter)) {
int res;
Py_BEGIN_CRITICAL_SECTION(fut);
res = future_awaited_by_add(state, (FutureObj *)fut, waiter);

@kumaraditya303 kumaraditya303 Feb 6, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Sorry, this should have been future_awaited_by_discard, fixing #129731.

I'm surprised that no tests failed, seems like test coverage is less for these functions...

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Feb 7, 2025
@kumaraditya303 @srinivasreddy
pythongh-91048: fix thread safety for asyncio stack introspection APIs (
c6650de
python#129399)
cmaloney pushed a commit to cmaloney/cpython that referenced this pull request Feb 8, 2025
@kumaraditya303 @cmaloney
pythongh-91048: fix thread safety for asyncio stack introspection APIs (
63d3c3c
python#129399)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@1st1 1st1 Awaiting requested review from 1st1 1st1 is a code owner
@asvetlov asvetlov Awaiting requested review from asvetlov asvetlov is a code owner
@willingc willingc Awaiting requested review from willingc willingc is a code owner
@ambv ambv Awaiting requested review from ambv
@pablogsal pablogsal Awaiting requested review from pablogsal

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news topic-asyncio

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@kumaraditya303
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.