From 6e92352001f840dcf77bedf9149f35303b802ffe Mon Sep 17 00:00:00 2001 From: peper0 Date: Mon, 14 Dec 2020 15:43:20 +0100 Subject: [PATCH] fix making too many ssh connections when pushing run cache (#4732) (#4733) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 Co-authored-by: Ruslan Kuprieiev Co-authored-by: Ruslan Kuprieiev --- dvc/tree/pool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dvc/tree/pool.py b/dvc/tree/pool.py index 0b223373e..9bff33ca4 100644 --- a/dvc/tree/pool.py +++ b/dvc/tree/pool.py @@ -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: