more graceful handling of intentional node crashing

pull/3529/head
KPrasch 2024-07-29 22:55:29 +07:00
parent 51ff0b4187
commit 98fb407e77
No known key found for this signature in database
3 changed files with 12 additions and 3 deletions

View File

@ -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 = (

View File

@ -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):
"""

View File

@ -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")