-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Home Assistant is warning that the music_assistant_jukebox integration is performing blocking disk I/O calls directly in the main asyncio event loop. This can degrade performance and lead to warnings like:
- Detected blocking call to open with args ('/config/www/jukebox/jukebox.html', 'wb') inside the event loop by custom integration 'music_assistant_jukebox' at custom_components/music_assistant_jukebox/init.py, line 120: shutil.copy2(src_file, dst_file)
Similar warnings appear for shutil.rmtree, shutil.copytree, and other open calls in:
custom_components/music_assistant_jukebox/init.py
custom_components/music_assistant_jukebox/image.py
Home Assistant 2025.7.2 detects these blocking calls and logs them under homeassistant.util.loop. According to the Home Assistant developer docs on blocking I/O, all disk operations must be offloaded to the executor.
Expected behavior:
All file operations (shutil.copy2, shutil.copytree, shutil.rmtree, open) should be executed in an executor thread to avoid blocking the main asyncio loop. No warnings about blocking calls should appear in the Home Assistant log.