fix making too many ssh connections when pushing run cache (#4732) (#4733)

* fix making too many ssh connections when pushing run cache (#4732)

* reformat

* generator should exit on GeneratorExit exception

* Update dvc/tree/ssh/__init__.py

* pool: close on Exception and not BaseException

Co-authored-by: Tomasz Łakota <[email protected]>
Co-authored-by: Ruslan Kuprieiev <[email protected]>
Co-authored-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
peper0
2020-12-14 16:43:20 +02:00
committed by GitHub
co-authored by Tomasz Łakota Ruslan Kuprieiev Ruslan Kuprieiev
parent 89c7f984ad
commit 6e92352001
+1 -1
View File
@@ -11,7 +11,7 @@ def get_connection(conn_func, *args, **kwargs):
conn = pool.get_connection()
try:
yield conn
except BaseException:
except Exception:
conn.close()
raise
else: