Просмотр исходного кода

Intercept SIGINT in backup writers

Gabriel Adrian Samfira 4 лет назад
Родитель
Сommit
f10eb6f80c
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      coriolis/providers/backup_writers.py

+ 4 - 4
coriolis/providers/backup_writers.py

@@ -323,7 +323,7 @@ class SSHBackupWriterImpl(BaseBackupWriterImpl):
             data = self._sender_q.get()
             data = self._sender_q.get()
             try:
             try:
                 self._send_msg(data)
                 self._send_msg(data)
-            except Exception as err:
+            except BaseException as err:
                 self._exception = err
                 self._exception = err
                 raise
                 raise
             finally:
             finally:
@@ -338,7 +338,7 @@ class SSHBackupWriterImpl(BaseBackupWriterImpl):
                     payload["offset"],
                     payload["offset"],
                     payload["msg_id"])
                     payload["msg_id"])
                 self._sender_q.put(data)
                 self._sender_q.put(data)
-            except Exception as err:
+            except BaseException as err:
                 self._exception = err
                 self._exception = err
                 raise
                 raise
             finally:
             finally:
@@ -632,7 +632,7 @@ class HTTPBackupWriterImpl(BaseBackupWriterImpl):
                         chunk, constants.COMPRESSION_FORMAT_GZIP)
                         chunk, constants.COMPRESSION_FORMAT_GZIP)
                     if compressed:
                     if compressed:
                         send_payload["encoding"] = 'gzip'
                         send_payload["encoding"] = 'gzip'
-                except Exception as err:
+                except BaseException as err:
                     LOG.exception(err)
                     LOG.exception(err)
                     self._exception = err
                     self._exception = err
                     self._comp_q.task_done()
                     self._comp_q.task_done()
@@ -672,7 +672,7 @@ class HTTPBackupWriterImpl(BaseBackupWriterImpl):
                     raise
                     raise
             try:
             try:
                 send()
                 send()
-            except Exception as err:
+            except BaseException as err:
                 # record the exception. We need to terminate
                 # record the exception. We need to terminate
                 # the writer if this is set
                 # the writer if this is set
                 LOG.exception(err)
                 LOG.exception(err)