Skip to content

Commit

Permalink
Fix: Failing to restart nddpd caused the exception to escalate
Browse files Browse the repository at this point in the history
The `ndppd` service is not always required and restarting it can fail.

While waiting for a better fix that prevents restarting the service too quickly, this logs an error instead of raising an exception.
  • Loading branch information
hoh committed Mar 21, 2024
1 parent 643004b commit 4ba5c4f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/aleph/vm/network/ndp_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from dataclasses import dataclass
from ipaddress import IPv6Network
from pathlib import Path
from subprocess import CalledProcessError

from aleph.vm.utils import run_in_subprocess

Expand All @@ -33,7 +34,11 @@ def __init__(self, host_network_interface: str):
@staticmethod
async def _restart_ndppd():
logger.debug("Restarting ndppd")
await run_in_subprocess(["systemctl", "restart", "ndppd"])
try:
await run_in_subprocess(["systemctl", "restart", "ndppd"])
except CalledProcessError as error:
logger.error("Failed to restart ndppd: %s", error)
# We do not raise the error here, since this should not crash the entire system

async def _update_ndppd_conf(self):
config = f"proxy {self.host_network_interface} {{\n"
Expand Down

0 comments on commit 4ba5c4f

Please sign in to comment.