-
Notifications
You must be signed in to change notification settings - Fork 50
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
Queue closing does not affect sync .put() calls in waiting state #237
Comments
Thanks for the question. I'm not sure if the exception raising is good for this case: it just means that every |
What about notifying |
Fixed by #267 |
Ooops. Sorry, you are right. |
Please feel free to propose a pull request. |
I also found a related problem. def threaded(sync_q):
print("before")
sync_q.put(1)
sync_q.put(2)
print("after")
queue = janus.Queue(1)
Thread(target=threaded, args=[queue.sync_q]).start()
for _ in range(min(32, (os.cpu_count() or 1) + 4)):
loop.run_in_executor(None, time.sleep, 1)
await queue.async_q.get()
queue.close() In this example, we fill the default executor with the maximum number of callbacks, which causes This behavior is caused by the |
Hi! I found some potentially unexpected behaviour of queue closing. If thread
producer
blocks on attempt to sync put to queue and we close queue in anothercontrol
thread, threadproducer
will wait forever. I suppose that expected behaviour should be aRuntimeError
in syncput()
method on queue closing. What do you think about it?Here is a code to reproduce this situation:
The text was updated successfully, but these errors were encountered: