# Queue termination

**URL:** https://discuss.python.org/t/queue-termination/18386
**Category:** Async-SIG
**Created:** [August 22, 2022, 4:11am UTC](https://discuss.python.org/t/queue-termination/18386 "2022-08-22T04:11:09Z")
**Posts on this page:** 1
**Showing post:** 46

<div class="post-metadata">

### Author: ![TeamSpen210](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/teamspen210/32/1004_2.png) [@TeamSpen210](https://discuss.python.org/u/TeamSpen210)
#### Post date: [December 1, 2022, 2:43am UTC](https://discuss.python.org/t/queue-termination/18386/46 "2022-12-01T02:43:36Z")

</div>

What should occur if `shutdown()` is called multiple times (potentially with different values for `immediate`)? Looking through the PR implementation currently, it seems like it could be possible for a second call to unset the immediate state while threads are waiting, causing some threads to raise the shutdown exception while others continue to `get()` items until the queues are empty. Perhaps `shutdown(immediate=False)` should be a no-op if the state is `shutdown-immediate` already?

---

_[View the full topic](https://discuss.python.org/t/queue-termination/18386)._
