This commit locks the db while importing and should help:
https://github.com/kovidgoyal/calibr...846b6275a8ef9e but you will need to wiat for next calibre release or run from source as described in the calibre user manual
https://manual.calibre-ebook.com/develop.html