Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: do not run sync commands via event loop
The asyncio event loop is not reentrant safe. By that, we must not interact with the event loop directly from any async (coro) context. This is especially problematic, as we don't know if a non-async command will interact with the eventloop somewhere down the stack. This became visible when reading the repo.dirty property from an async context, as it internally uses run_cmd which internally calls ev.run_until_complete(). This property further was cached, which sometimes hid the bug. To fix this, the async and the non-async code paths need to be strictly separated. This is possible by porting over the run_cmd from event loop based waiting to subprocess.run. By that, we loose the liveoutput command, which is anyways only used by a single invocation in the build plugin. This now explicitly interacts with the event loop to restore the behavior. Reported-by: Konrad Weihmann <konrad.weihmann@avnet.eu> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
- Loading branch information