projects
/
music-assistant-server.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a4ca978
)
Fix buffered generator hang by ensuring None sentinel delivery (#2566)
author
Maxim Raznatovski
<nda.mr43@gmail.com>
Tue, 28 Oct 2025 20:46:54 +0000
(21:46 +0100)
committer
GitHub
<noreply@github.com>
Tue, 28 Oct 2025 20:46:54 +0000
(21:46 +0100)
music_assistant/helpers/buffered_generator.py
patch
|
blob
|
history
diff --git
a/music_assistant/helpers/buffered_generator.py
b/music_assistant/helpers/buffered_generator.py
index 42902d122e2101b174b23b1e05e32b06b7dda4c9..523b4883376c174df36acbb23793c81f4471f9d6 100644
(file)
--- a/
music_assistant/helpers/buffered_generator.py
+++ b/
music_assistant/helpers/buffered_generator.py
@@
-78,8
+78,10
@@
async def buffered(
if not generator_consumed:
await close_async_generator(generator)
# Signal end of stream by putting None
- with contextlib.suppress(asyncio.QueueFull):
- buffer.put_nowait(None)
+ # We must wait for space in the queue if needed, otherwise the consumer may
+ # hang waiting for data that will never come
+ if not cancelled.is_set():
+ await buffer.put(None)
# Start the producer task
loop = asyncio.get_running_loop()