Skip to content

Commit 5e0547b

Browse files
committed
Do not share subprocess lock between instances
Signed-off-by: Aleksei Stepanov <penguinolog@gmail.com> (cherry picked from commit 82da78d) Signed-off-by: Aleksei Stepanov <penguinolog@gmail.com>
1 parent de52a20 commit 5e0547b

File tree

5 files changed

+7
-93
lines changed

5 files changed

+7
-93
lines changed

doc/source/Subprocess.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ API: Subprocess
2121
.. versionchanged:: 3.1.0 Not singleton anymore. Only lock is shared between all instances.
2222
.. versionchanged:: 3.2.0 Logger can be enforced.
2323
.. versionchanged:: 4.1.0 support chroot
24+
.. versionchanged:: 4.3.0 Lock is not shared anymore: allow parallel call of different instances
2425

2526
.. py:attribute:: log_mask_re
2627

exec_helpers/async_api/subprocess_runner.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
from exec_helpers import _log_templates
3131
from exec_helpers import _subprocess_helpers
3232
from exec_helpers import exceptions
33-
from exec_helpers import metaclasses # pylint: disable=unused-import
3433
from exec_helpers import subprocess_runner
3534
from exec_helpers.async_api import api
3635
from exec_helpers.async_api import exec_result
@@ -64,7 +63,7 @@ def stdout(self) -> typing.Optional[asyncio.StreamReader]: # type: ignore
6463
return super(SubprocessExecuteAsyncResult, self).stdout
6564

6665

67-
class Subprocess(api.ExecHelper, metaclass=metaclasses.SingleLock):
66+
class Subprocess(api.ExecHelper):
6867
"""Subprocess helper with timeouts and lock-free FIFO."""
6968

7069
__slots__ = ()
@@ -85,6 +84,8 @@ def __init__(
8584
8685
.. versionchanged:: 3.1.0 Not singleton anymore. Only lock is shared between all instances.
8786
.. versionchanged:: 3.2.0 Logger can be enforced.
87+
.. versionchanged:: 4.1.0 support chroot
88+
.. versionchanged:: 4.3.0 Lock is not shared anymore: allow parallel call of different instances.
8889
"""
8990
super(Subprocess, self).__init__(logger=logger, log_mask_re=log_mask_re)
9091

exec_helpers/metaclasses.py

Lines changed: 0 additions & 88 deletions
This file was deleted.

exec_helpers/subprocess_runner.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
from exec_helpers import api
3636
from exec_helpers import exceptions
3737
from exec_helpers import exec_result
38-
from exec_helpers import metaclasses # pylint: disable=unused-import
3938

4039

4140
# noinspection PyTypeHints
@@ -63,7 +62,7 @@ def stdout(self) -> typing.Optional[typing.IO]: # type: ignore
6362
return super(SubprocessExecuteAsyncResult, self).stdout
6463

6564

66-
class Subprocess(api.ExecHelper, metaclass=metaclasses.SingleLock):
65+
class Subprocess(api.ExecHelper):
6766
"""Subprocess helper with timeouts and lock-free FIFO."""
6867

6968
def __init__(
@@ -85,6 +84,8 @@ def __init__(
8584
.. versionchanged:: 1.2.0 log_mask_re regex rule for masking cmd
8685
.. versionchanged:: 3.1.0 Not singleton anymore. Only lock is shared between all instances.
8786
.. versionchanged:: 3.2.0 Logger can be enforced.
87+
.. versionchanged:: 4.1.0 support chroot
88+
.. versionchanged:: 4.3.0 Lock is not shared anymore: allow parallel call of different instances.
8889
"""
8990
super(Subprocess, self).__init__(logger=logger, log_mask_re=log_mask_re)
9091

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ def _extension(modpath):
6868
_extension("exec_helpers.constants"),
6969
_extension("exec_helpers.exceptions"),
7070
_extension("exec_helpers.exec_result"),
71-
_extension("exec_helpers.metaclasses"),
7271
_extension("exec_helpers.proc_enums"),
7372
_extension("exec_helpers.ssh_auth"),
7473
_extension("exec_helpers.ssh_client"),

0 commit comments

Comments
 (0)