On 02/11/2021 13:41, Vladimir Sementsov-Ogievskiy wrote:
Hmm. subject looks like it's safe to remove aiocontext locks from any qmp command?

For example, commit 91005a495e228eb added aiocontext locks back to qmp bitmap add/remove commands because otherwise they crashed.

So, I'm not sure that being under BQL is enough to drop aiocontext locking..



In this specific case the aiocontext is useless there. I am not sure what it was used for before, but if you look at what it protects in this patch we have:

- block_job_query: not called by anyone else, and internally calls:
* block_job_is_internal = checks struct job id, that is only written at job initialization
        * progress_get_snapshot = we made it thread safe, as you might remember
* accesses struct job fields, that we protect anyways with job_mutex. Anyways the aiocontext is not used to protect jobs fields.

- job_query_single: same as block_job_query, calls progress_get_snapshot and accesses job fields.

So yes, I am positive that here removing the aiocontext lock does not break anything.

Thank you,
Emanuele


Reply via email to