mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
summon: protect chdir/import/call with a thread lock
This commit is contained in:
+3
-7
@@ -4,7 +4,9 @@ import sys
|
||||
import copy
|
||||
from urllib.parse import urlparse
|
||||
from contextlib import contextmanager, _GeneratorContextManager as GCM
|
||||
import threading
|
||||
|
||||
from funcy import wrap_with
|
||||
import ruamel.yaml
|
||||
from voluptuous import Schema, Required, Invalid
|
||||
|
||||
@@ -154,14 +156,8 @@ def _pull_dependencies(repo, deps):
|
||||
out.checkout()
|
||||
|
||||
|
||||
@wrap_with(threading.Lock())
|
||||
def _invoke_method(call, args, path):
|
||||
# XXX: Some issues with this approach:
|
||||
# * Not thread safe
|
||||
# * Import will pollute sys.modules
|
||||
# * Weird errors if there is a name clash within sys.modules
|
||||
|
||||
# XXX: sys.path manipulation is "theoretically" not needed
|
||||
# but tests are failing for an unknown reason.
|
||||
cwd = os.getcwd()
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user