-
Notifications
You must be signed in to change notification settings - Fork 81
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
[Bug] GeneratorExit inadvertently caught, and also core timer mismatch #325
Comments
Here's the issue for @workflow.defn
class MyWorkflow:
@workflow.run
async def run(self) -> None:
try:
for _ in range(20):
# With cache disabled, this is evicted which when GC'd causes
# this to throw a GeneratorExit (which is usually ok)
await asyncio.sleep(0.5)
finally:
# This tries to run on GeneratorExit, but fails with a RuntimeError
# of "no running event loop". Since this finally was not written well
# it swallows the GeneratorExit error making Python mad it didn't
# receive the error
await asyncio.sleep(1) So, the
I am still investigating how I can try to tear down the event loop without it waking up. I am also still investigating how core timers can get out of sync here. My first thought was this is an old activation completing, but that doesn't seem accurate. |
Describe the bug
There are two problems here:
GeneratorExit is caught somewhere
When a coroutine is closed, Python throws a
GeneratorExit
from the coroutine and expects that to be bubbled out. But somewhere we are not bubbling that out so Python throws a runtime exception on this. So we're getting:With a stack trace.
Core timer error
When workflow is evicted, sometimes when it reruns from scratch it gets something like:
Unsure if this is due to
GeneratorExit
above or if that failure just surfaced the problem.Replication
This is based on a user repo. This disables cache and makes a bunch of timers. But this causes constant evictions for each timer and signal sent which is causing the
GeneratorExit
issue. But thatGeneratorExit
issue is also causing this core error. I have not yet determined whether theGeneratorExit
issue is surfacing a core bug or is just the bug itself w/ an eviction problem and core is somehow showing it.The text was updated successfully, but these errors were encountered: