mirror of https://github.com/nucypher/nucypher.git
more graceful handling of intentional node crashing
parent
51ff0b4187
commit
98fb407e77
|
@ -577,8 +577,8 @@ class Operator(BaseActor):
|
|||
self.check_ferveo_public_key_match()
|
||||
except FerveoKeyMismatch:
|
||||
# crash this node
|
||||
self.stop()
|
||||
exit()
|
||||
self.stop(halt_reactor=True)
|
||||
return
|
||||
|
||||
if self.checksum_address not in participants:
|
||||
message = (
|
||||
|
|
|
@ -994,7 +994,11 @@ class Ursula(Teacher, Character, Operator):
|
|||
if self._prometheus_metrics_tracker:
|
||||
self._prometheus_metrics_tracker.stop()
|
||||
if halt_reactor:
|
||||
reactor.stop()
|
||||
self.halt_reactor()
|
||||
|
||||
@staticmethod
|
||||
def halt_reactor() -> None:
|
||||
reactor.stop()
|
||||
|
||||
def _finalize(self):
|
||||
"""
|
||||
|
|
|
@ -836,3 +836,8 @@ def mock_async_hooks(mocker):
|
|||
)
|
||||
|
||||
return hooks
|
||||
|
||||
|
||||
@pytest.fixture(scope="session", autouse=True)
|
||||
def mock_halt_reactor(session_mocker):
|
||||
session_mocker.patch.object(Ursula, "halt_reactor")
|
||||
|
|
Loading…
Reference in New Issue