GeezerVison is showing github.com — [WIP] Investigate asyncio compiler error in wait method by Copilot · Pull Request #6737 · RustPython/RustPython
Conversation
Copilot
AI
commented
Jan 15, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
- Investigate try/finally exception handling around async await to align with CPython
- Add focused codegen test covering raise inside finally in async context
- Implement minimal codegen fix for finally exception routing
- Run targeted codegen tests
Original prompt
This section details on the original issue you should resolve
<issue_title>Investigate asyncio compiler error</issue_title>
<issue_description>## Summary
Originally reported from: #6601 (comment)
Details
written by @terryluan12
As an update, I've narrowed down the hang to an issue in the wait method of the Condition class. I think it's an issue with the AST generation? (but not 100%)
The test that is failing is test_locks.ConditionTests.test_cancelled_error_re_aquire
The relevant function is below
async def wait(self):
"""Wait until notified.
If the calling task has not acquired the lock when this
method is called, a RuntimeError is raised.
This method releases the underlying lock, and then blocks
until it is awakened by a notify() or notify_all() call for
the same condition variable in another task. Once
awakened, it re-acquires the lock and returns True.
This method may return spuriously,
which is why the caller should always
re-check the state and be prepared to wait() again.
"""
if not self.locked():
raise RuntimeError('cannot wait on un-acquired lock')
fut = self._get_loop().create_future()
self.release()
try:
try:
self._waiters.append(fut)
try:
await fut # A) It reaches here fine
return True
finally:
self._waiters.remove(fut)
finally:
# Must re-acquire lock even if wait is cancelled.
# We only catch CancelledError here, since we don't want any
# other (fatal) errors with the future to cause us to spin.
err = None
while True: # B) The code enters a loop here to reacquire the lock
try:
await self.acquire() # C) While waiting here, the task is cancelled
break
except exceptions.CancelledError as e:
err = e # D) The code reaches here fine
if err is not None:
try:
raise err # E) The error is reraised here
finally:
err = None # F) It reaches here
except BaseException:
self._notify(1) # G) It is supposed to exit here
raise
Whereas in CPython, the program is supposed to go from F) to G), RustPython instead goes from F) to B), re-entering the final statement again (reaquiring the lock again at C), reaching a deadlock state, and hanging.</issue_description>
<agent_instructions>Investigate the asyncio compiler bug and try to align it with CPython 3.14 compiler</agent_instructions>
Comments on the Issue (you are @copilot in this section)
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Important
Review skipped
Bot user detected.
To trigger a single review, invoke the @coderabbitai review command.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Comment @coderabbitai help to get the list of available commands and usage tips.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Do you think Copilot is running out of RAM?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
"400 Your input exceeds the context window of this model. Please adjust your input and try again."
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@manoelhc could you share how did you check that? I expected those kind of message from error or in session, but couldn't find one
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
youknowone
Awaiting requested review from youknowone
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Investigate asyncio compiler error
Uh oh!
There was an error while loading. Please reload this page.
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.
|