Pārlūkot izejas kodu

Catch OSError in MPFuture (#409)

* Catch OSError in MPFuture

* Run tests for external pull requests

Co-authored-by: justheuristic <justheuristic@gmail.com>
Artem Chumachenko 3 gadi atpakaļ
vecāks
revīzija
99a0c18ca9

+ 1 - 1
.github/workflows/check-style.yml

@@ -1,6 +1,6 @@
 name: Check style
 
-on: [ push ]
+on: [ push, pull_request ]
 
 jobs:
   black:

+ 1 - 1
.github/workflows/run-tests.yml

@@ -1,6 +1,6 @@
 name: Tests
 
-on: [ push ]
+on: [ push, pull_request ]
 
 
 jobs:

+ 1 - 1
hivemind/utils/mpfuture.py

@@ -201,7 +201,7 @@ class MPFuture(base.Future, Generic[ResultType]):
         try:
             with MPFuture._update_lock if self._use_lock else nullcontext():
                 self._sender_pipe.send((self._uid, update_type, payload))
-        except (ConnectionError, BrokenPipeError, EOFError) as e:
+        except (ConnectionError, BrokenPipeError, EOFError, OSError) as e:
             logger.debug(f"No updates were sent: pipe to origin process was broken ({e}).", exc_info=True)
 
     def set_result(self, result: ResultType):