Skip to content

don't store exceptionfor identity check#2004

Draft
maxbachmann wants to merge 2 commits intomicrosoft:mainfrom
maxbachmann:patch-2
Draft

don't store exceptionfor identity check#2004
maxbachmann wants to merge 2 commits intomicrosoft:mainfrom
maxbachmann:patch-2

Conversation

@maxbachmann
Copy link

@maxbachmann maxbachmann commented Mar 5, 2026

I did look a bit deeper into #1999 and the state was kept alive by State -> Generator -> Frame -> GeneratorExit Exception

Debugpy stores the current exception during unwind for an identity check and only unsets it on the next unwind.

This PR changes this to only store the id which fixes the issue. However to avoid issues on id reuse, this id has to be unset again when a new exception is raised on the thread. This requires having to always listen to monitor.events.RAISE.

@rchiodo do you have a better idea on how we can only hold the exception while required?

I didn't update the generated cython file since I didn't directly know how to do this + this is more of a draft on how this could be solved for now

@maxbachmann maxbachmann requested a review from a team as a code owner March 5, 2026 04:47
@maxbachmann maxbachmann marked this pull request as draft March 5, 2026 04:48
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.

1 participant