-
Notifications
You must be signed in to change notification settings - Fork 535
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
Faust Agent & Process hangs when using topic.take() #262
Comments
Here is the full stack trace from pyrasite:
Posted it before looking it over; doesn't look useful. |
It seems that wait_empty gets stuck in an infinite loop (
|
I think this is could be a result of trying to try/finally in a (async) generator. PEP 255 Simple Generators states:
I'm not sure if this applies to async generators Lines 338 to 341 in 5d8152d
In any case, the I don't understand why this doesn't happen on normal iteration however in Possible related to python-trio/trio#265? |
Ignore my last comment import asyncio
import uvloop
async def sample():
for i in range(10):
try:
yield i
finally:
print(f"finished iter of {i}")
async def main():
try:
async for val in sample():
print(val)
if val > 5:
x = {"a": "b"}
y = x["f"]
except Exception:
print("exception")
raise
finally:
print("cleaning up main")
if __name__ == "__main__":
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
loop = asyncio.get_event_loop()
# Blocking call which returns when the hello_world() coroutine is done
loop.run_until_complete(main())
loop.close() works completely fine. I'm not sure why the finalizer doesn't seem to execute in this case. Also adding a |
…n to prevent deadlocks Fixes robinhood#262
…n to prevent deadlocks Fixes robinhood#262
…n to prevent deadlocks Fixes robinhood#262
Checklist
master
branch of Faust.Steps to reproduce
https://gist.github.com/nemosupremo/2f7a12119c5106c6624cd8d7467e8e77
Run this worker, which should crash and never recover. An Interrupt (ctrl+c) will cause an indefinite hang. Note that with
topic.items()
the crash doesn't occur, it only occurs withtopic.take(x, within=y)
Expected behavior
The agent restarts and/or crashes the application.
Actual behavior
The Application hangs indefinitely.
Full traceback
n/a
Versions
The text was updated successfully, but these errors were encountered: