mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-11-17 01:04:51 +02:00
Prevent parallel execution of VBox commands
In theory it should not be a problem. But It's create issues like this one: Fix: https://github.com/GNS3/gns3-gui/issues/261
This commit is contained in:
parent
6ec081c774
commit
e51a129216
@ -41,6 +41,7 @@ class VirtualBox(BaseManager):
|
||||
|
||||
super().__init__()
|
||||
self._vboxmanage_path = None
|
||||
self._execute_lock = asyncio.Lock()
|
||||
|
||||
@property
|
||||
def vboxmanage_path(self):
|
||||
@ -82,6 +83,10 @@ class VirtualBox(BaseManager):
|
||||
@asyncio.coroutine
|
||||
def execute(self, subcommand, args, timeout=60):
|
||||
|
||||
# We use a lock prevent parallel execution due to strange errors
|
||||
# reported by a user and reproduced by us.
|
||||
# https://github.com/GNS3/gns3-gui/issues/261
|
||||
with (yield from self._execute_lock):
|
||||
vboxmanage_path = self.vboxmanage_path
|
||||
if not vboxmanage_path:
|
||||
vboxmanage_path = self.find_vboxmanage()
|
||||
|
Loading…
Reference in New Issue
Block a user