mirror of https://github.com/EdgeVPNio/evio.git
Update paramter names
parent
e0887dfba5
commit
c9a2768d18
|
@ -40,18 +40,18 @@ __all__ = [
|
||||||
"BROKER_LOG_NAME",
|
"BROKER_LOG_NAME",
|
||||||
"TINCAN_LOG_NAME",
|
"TINCAN_LOG_NAME",
|
||||||
"PERFDATA_LOG_NAME",
|
"PERFDATA_LOG_NAME",
|
||||||
"TINCAN_CHK_INTERVAL",
|
"TC_PRCS_CHK_INTERVAL",
|
||||||
"MAX_FILE_SIZE",
|
"MAX_FILE_SIZE",
|
||||||
"MAX_ARCHIVES",
|
"MAX_ARCHIVES",
|
||||||
"CONSOLE_LEVEL",
|
"CONSOLE_LEVEL",
|
||||||
"DEVICE",
|
"DEVICE",
|
||||||
"EVENT_PERIOD",
|
"TIMER_EVENT_PERIOD",
|
||||||
"CBT_LIFESPAN",
|
"CBT_DFLT_TIMEOUT",
|
||||||
"LINK_SETUP_TIMEOUT",
|
"LINK_SETUP_TIMEOUT",
|
||||||
"JID_RESOLUTION_TIMEOUT",
|
"JID_RESOLUTION_TIMEOUT",
|
||||||
"CONTROLLER_TIMER_INTERVAL",
|
"CM_TIMER_EVENT_INTERVAL",
|
||||||
"CACHE_EXPIRY_INTERVAL",
|
"CACHE_ENTRY_TIMEOUT",
|
||||||
"PRESENCE_INTERVAL",
|
"PRESENCE_UPDATE_INTERVAL",
|
||||||
"BR_NAME_MAX_LENGTH",
|
"BR_NAME_MAX_LENGTH",
|
||||||
"NAME_PREFIX_EVI",
|
"NAME_PREFIX_EVI",
|
||||||
"NAME_PREFIX_APP_BR",
|
"NAME_PREFIX_APP_BR",
|
||||||
|
@ -63,13 +63,13 @@ __all__ = [
|
||||||
"GENEVE_SETUP_TIMEOUT",
|
"GENEVE_SETUP_TIMEOUT",
|
||||||
"MIN_SUCCESSORS",
|
"MIN_SUCCESSORS",
|
||||||
"MAX_ON_DEMAND_EDGES",
|
"MAX_ON_DEMAND_EDGES",
|
||||||
"EXCLUSION_BASE_INTERVAL",
|
"PEER_EXCLUSION_INTERVAL",
|
||||||
"MAX_SUCCESSIVE_FAILS",
|
"MAX_SUCCESSIVE_FAILS",
|
||||||
"TRIM_CHECK_INTERVAL",
|
"TRIM_CHECK_INTERVAL",
|
||||||
"MAX_CONCURRENT_OPS",
|
"MAX_CONCURRENT_OPS",
|
||||||
"SUCCESSIVE_FAIL_INCR",
|
"SUCCESSIVE_FAIL_INCR",
|
||||||
"SUCCESSIVE_FAIL_DECR",
|
"SUCCESSIVE_FAIL_DECR",
|
||||||
"STALE_INTERVAL",
|
"PEER_CHKIN_TIMEOUT",
|
||||||
"MAX_HEARTBEATS",
|
"MAX_HEARTBEATS",
|
||||||
"perfd",
|
"perfd",
|
||||||
"CONFIG",
|
"CONFIG",
|
||||||
|
@ -89,6 +89,7 @@ __all__ = [
|
||||||
"introspect",
|
"introspect",
|
||||||
"delim_mac_str",
|
"delim_mac_str",
|
||||||
"statement_false",
|
"statement_false",
|
||||||
|
"TC_REQUEST_TIMEOUT",
|
||||||
]
|
]
|
||||||
EVIO_VER_REL: str = f"{EVIO_VER_MJR}.{EVIO_VER_MNR}.{EVIO_VER_REV}.{EVIO_VER_BLD}"
|
EVIO_VER_REL: str = f"{EVIO_VER_MJR}.{EVIO_VER_MNR}.{EVIO_VER_REV}.{EVIO_VER_BLD}"
|
||||||
LOG_DIRECTORY = "/var/log/evio/"
|
LOG_DIRECTORY = "/var/log/evio/"
|
||||||
|
@ -96,19 +97,11 @@ BROKER_LOG_LEVEL = "INFO"
|
||||||
LOG_LEVEL = "INFO"
|
LOG_LEVEL = "INFO"
|
||||||
BROKER_LOG_NAME = "broker.log"
|
BROKER_LOG_NAME = "broker.log"
|
||||||
TINCAN_LOG_NAME = "tincan"
|
TINCAN_LOG_NAME = "tincan"
|
||||||
TINCAN_CHK_INTERVAL: Literal[5] = 5
|
|
||||||
PERFDATA_LOG_NAME = "perf.data"
|
PERFDATA_LOG_NAME = "perf.data"
|
||||||
MAX_FILE_SIZE = 10000000 # 10MB sized log files
|
MAX_FILE_SIZE = 10000000 # 10MB sized log files
|
||||||
MAX_ARCHIVES = 5
|
MAX_ARCHIVES = 5
|
||||||
CONSOLE_LEVEL = None
|
CONSOLE_LEVEL = "ERROR"
|
||||||
DEVICE = "File"
|
DEVICE = "File"
|
||||||
EVENT_PERIOD: Literal[1] = 1
|
|
||||||
CBT_LIFESPAN: Literal[180] = 180
|
|
||||||
JID_RESOLUTION_TIMEOUT: Literal[15] = 15
|
|
||||||
LINK_SETUP_TIMEOUT: Literal[180] = 180
|
|
||||||
CONTROLLER_TIMER_INTERVAL: Literal[30] = 30
|
|
||||||
CACHE_EXPIRY_INTERVAL: Literal[60] = 60
|
|
||||||
PRESENCE_INTERVAL: Literal[30] = 30
|
|
||||||
BR_NAME_MAX_LENGTH: Literal[15] = 15
|
BR_NAME_MAX_LENGTH: Literal[15] = 15
|
||||||
NAME_PREFIX_EVI: Literal["evi"] = "evi"
|
NAME_PREFIX_EVI: Literal["evi"] = "evi"
|
||||||
NAME_PREFIX_APP_BR: Literal["app"] = "app"
|
NAME_PREFIX_APP_BR: Literal["app"] = "app"
|
||||||
|
@ -117,17 +110,26 @@ BRIDGE_AUTO_DELETE: Literal[True] = True
|
||||||
DEFAULT_BRIDGE_PROVIDER: Literal["OVS"] = "OVS"
|
DEFAULT_BRIDGE_PROVIDER: Literal["OVS"] = "OVS"
|
||||||
DEFAULT_SWITCH_PROTOCOL: Literal["BF"] = "BF"
|
DEFAULT_SWITCH_PROTOCOL: Literal["BF"] = "BF"
|
||||||
SDN_CONTROLLER_PORT: Literal[6633] = 6633
|
SDN_CONTROLLER_PORT: Literal[6633] = 6633
|
||||||
GENEVE_SETUP_TIMEOUT: Literal[180] = 180
|
|
||||||
MIN_SUCCESSORS: Literal[2] = 2
|
MIN_SUCCESSORS: Literal[2] = 2
|
||||||
MAX_ON_DEMAND_EDGES: Literal[3] = 3
|
MAX_ON_DEMAND_EDGES: Literal[3] = 3
|
||||||
EXCLUSION_BASE_INTERVAL: Literal[60] = 60
|
|
||||||
MAX_SUCCESSIVE_FAILS: Literal[4] = 4
|
MAX_SUCCESSIVE_FAILS: Literal[4] = 4
|
||||||
TRIM_CHECK_INTERVAL: Literal[300] = 300
|
|
||||||
MAX_CONCURRENT_OPS: Literal[1] = 1
|
MAX_CONCURRENT_OPS: Literal[1] = 1
|
||||||
SUCCESSIVE_FAIL_INCR: Literal[1] = 1
|
SUCCESSIVE_FAIL_INCR: Literal[1] = 1
|
||||||
SUCCESSIVE_FAIL_DECR: Literal[2] = 2
|
SUCCESSIVE_FAIL_DECR: Literal[2] = 2
|
||||||
STALE_INTERVAL = float(2 * 3600) # 2 hrs
|
MAX_HEARTBEATS: Literal[3] = 3
|
||||||
MAX_HEARTBEATS: Literal[5] = 3
|
TIMER_EVENT_PERIOD: Literal[1] = 1
|
||||||
|
CM_TIMER_EVENT_INTERVAL: Literal[30] = 30
|
||||||
|
PRESENCE_UPDATE_INTERVAL: Literal[30] = 30
|
||||||
|
PEER_EXCLUSION_INTERVAL: Literal[60] = 60
|
||||||
|
TRIM_CHECK_INTERVAL: Literal[300] = 300
|
||||||
|
TC_PRCS_CHK_INTERVAL: Literal[5] = 5 # tincan process checks
|
||||||
|
CACHE_ENTRY_TIMEOUT: Literal[60] = 60
|
||||||
|
PEER_CHKIN_TIMEOUT: Literal[7200] = 7200 # 2 hrs
|
||||||
|
CBT_DFLT_TIMEOUT: Literal[150] = 160
|
||||||
|
JID_RESOLUTION_TIMEOUT: Literal[15] = 15
|
||||||
|
GENEVE_SETUP_TIMEOUT: Literal[90] = 90
|
||||||
|
LINK_SETUP_TIMEOUT: Literal[120] = 130
|
||||||
|
TC_REQUEST_TIMEOUT: Literal[30] = 30 # exipry of a req to tincan
|
||||||
|
|
||||||
perfd = PerformanceData(LogFile=os.path.join(LOG_DIRECTORY, PERFDATA_LOG_NAME))
|
perfd = PerformanceData(LogFile=os.path.join(LOG_DIRECTORY, PERFDATA_LOG_NAME))
|
||||||
|
|
||||||
|
|
|
@ -42,9 +42,9 @@ from typing import Any
|
||||||
from . import (
|
from . import (
|
||||||
BROKER_LOG_LEVEL,
|
BROKER_LOG_LEVEL,
|
||||||
BROKER_LOG_NAME,
|
BROKER_LOG_NAME,
|
||||||
|
CM_TIMER_EVENT_INTERVAL,
|
||||||
CONFIG,
|
CONFIG,
|
||||||
CONSOLE_LEVEL,
|
CONSOLE_LEVEL,
|
||||||
CONTROLLER_TIMER_INTERVAL,
|
|
||||||
DEVICE,
|
DEVICE,
|
||||||
EVIO_VER_REL,
|
EVIO_VER_REL,
|
||||||
JID_RESOLUTION_TIMEOUT,
|
JID_RESOLUTION_TIMEOUT,
|
||||||
|
@ -312,7 +312,7 @@ class Broker:
|
||||||
# get the controller class from the class name
|
# get the controller class from the class name
|
||||||
ctrl_class = getattr(module, ctrl_cls_name)
|
ctrl_class = getattr(module, ctrl_cls_name)
|
||||||
timer_interval = self.cfg_controllers[ctrl_cls_name].get(
|
timer_interval = self.cfg_controllers[ctrl_cls_name].get(
|
||||||
"TimerInterval", CONTROLLER_TIMER_INTERVAL
|
"TimerInterval", CM_TIMER_EVENT_INTERVAL
|
||||||
)
|
)
|
||||||
nexus = Nexus(self, timer_interval=timer_interval)
|
nexus = Nexus(self, timer_interval=timer_interval)
|
||||||
ctrl_config = self._config.get(ctrl_cls_name)
|
ctrl_config = self._config.get(ctrl_cls_name)
|
||||||
|
|
|
@ -23,7 +23,7 @@ import time
|
||||||
import uuid
|
import uuid
|
||||||
from typing import Any, Optional
|
from typing import Any, Optional
|
||||||
|
|
||||||
from . import CBT_LIFESPAN, introspect
|
from . import CBT_DFLT_TIMEOUT, introspect
|
||||||
|
|
||||||
|
|
||||||
class CBT:
|
class CBT:
|
||||||
|
@ -120,7 +120,7 @@ class CBT:
|
||||||
self.k = v
|
self.k = v
|
||||||
else:
|
else:
|
||||||
self.context[k] = v
|
self.context[k] = v
|
||||||
self.lifespan = CBT_LIFESPAN
|
self.lifespan = CBT_DFLT_TIMEOUT
|
||||||
self.time_created: float = 0.0
|
self.time_created: float = 0.0
|
||||||
self.time_submited: float = 0.0
|
self.time_submited: float = 0.0
|
||||||
self.time_completed: float = 0.0
|
self.time_completed: float = 0.0
|
||||||
|
|
|
@ -23,7 +23,7 @@ import queue
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from . import CONTROLLER_TIMER_INTERVAL, EVENT_PERIOD
|
from . import CM_TIMER_EVENT_INTERVAL, TIMER_EVENT_PERIOD
|
||||||
from .cbt import CBT
|
from .cbt import CBT
|
||||||
from .process_proxy import ProxyMsg
|
from .process_proxy import ProxyMsg
|
||||||
from .timed_transactions import Transaction
|
from .timed_transactions import Transaction
|
||||||
|
@ -40,7 +40,7 @@ class Nexus:
|
||||||
self._broker = broker_object # broker object reference
|
self._broker = broker_object # broker object reference
|
||||||
self._exit_event = threading.Event()
|
self._exit_event = threading.Event()
|
||||||
self.update_timer_interval(
|
self.update_timer_interval(
|
||||||
kwargs.get("timer_interval", CONTROLLER_TIMER_INTERVAL)
|
kwargs.get("timer_interval", CM_TIMER_EVENT_INTERVAL)
|
||||||
)
|
)
|
||||||
self._timer_loop_cnt: int = 1
|
self._timer_loop_cnt: int = 1
|
||||||
|
|
||||||
|
@ -113,8 +113,8 @@ class Nexus:
|
||||||
|
|
||||||
def update_timer_interval(self, interval: int):
|
def update_timer_interval(self, interval: int):
|
||||||
self._timer_interval: int = interval
|
self._timer_interval: int = interval
|
||||||
if self._timer_interval < EVENT_PERIOD:
|
if self._timer_interval < TIMER_EVENT_PERIOD:
|
||||||
self._timer_interval = EVENT_PERIOD
|
self._timer_interval = TIMER_EVENT_PERIOD
|
||||||
|
|
||||||
def start_controller(self):
|
def start_controller(self):
|
||||||
self._cm_thread.start()
|
self._cm_thread.start()
|
||||||
|
|
|
@ -3,7 +3,7 @@ import sched
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from . import EVENT_PERIOD
|
from . import TIMER_EVENT_PERIOD
|
||||||
|
|
||||||
|
|
||||||
class Transaction:
|
class Transaction:
|
||||||
|
@ -25,7 +25,7 @@ class TimedTransactions:
|
||||||
self._event_thread = threading.Thread(
|
self._event_thread = threading.Thread(
|
||||||
target=self._run, name=thread_name, daemon=False
|
target=self._run, name=thread_name, daemon=False
|
||||||
)
|
)
|
||||||
self._chk_interval = float(EVENT_PERIOD)
|
self._chk_interval = float(TIMER_EVENT_PERIOD)
|
||||||
self._sched = sched.scheduler()
|
self._sched = sched.scheduler()
|
||||||
|
|
||||||
def register(self, entry: Transaction):
|
def register(self, entry: Transaction):
|
||||||
|
|
|
@ -615,7 +615,7 @@ class BridgeController(ControllerModule):
|
||||||
self.logger.warning(
|
self.logger.warning(
|
||||||
"A module shutdown error occurred: %s", err, exc_info=True
|
"A module shutdown error occurred: %s", err, exc_info=True
|
||||||
)
|
)
|
||||||
self.logger.info("Controller module terminating")
|
self.logger.info("Controller module terminated")
|
||||||
|
|
||||||
def req_handler_vis_data(self, cbt: CBT):
|
def req_handler_vis_data(self, cbt: CBT):
|
||||||
br_data = {}
|
br_data = {}
|
||||||
|
|
|
@ -68,7 +68,7 @@ class GeneveTunnel(ControllerModule):
|
||||||
for tnl in self._tunnels.values():
|
for tnl in self._tunnels.values():
|
||||||
self._remove_tunnel(tnl.tap_name)
|
self._remove_tunnel(tnl.tap_name)
|
||||||
self._tunnels.clear()
|
self._tunnels.clear()
|
||||||
self.logger.info("Controller module terminating")
|
self.logger.info("Controller module terminated")
|
||||||
|
|
||||||
def _deauth_tnl(self, tnl: Tunnel):
|
def _deauth_tnl(self, tnl: Tunnel):
|
||||||
self._tunnels.pop(tnl.tnlid, None)
|
self._tunnels.pop(tnl.tnlid, None)
|
||||||
|
|
|
@ -70,7 +70,6 @@ class Tunnel:
|
||||||
self.link = None
|
self.link = None
|
||||||
self.peer_mac = None
|
self.peer_mac = None
|
||||||
self.state = tnl_state
|
self.state = tnl_state
|
||||||
self.dataplane = dataplane
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return broker.introspect(self)
|
return broker.introspect(self)
|
||||||
|
@ -133,7 +132,7 @@ class LinkManager(ControllerModule):
|
||||||
self.logger.info("Controller module loaded")
|
self.logger.info("Controller module loaded")
|
||||||
|
|
||||||
def terminate(self):
|
def terminate(self):
|
||||||
self.logger.info("Controller module terminating")
|
self.logger.info("Controller module terminated")
|
||||||
|
|
||||||
def abort_handler_tunnel(self, cbt: CBT):
|
def abort_handler_tunnel(self, cbt: CBT):
|
||||||
self.logger.debug("Aborting CBT %s", cbt)
|
self.logger.debug("Aborting CBT %s", cbt)
|
||||||
|
@ -370,7 +369,7 @@ class LinkManager(ControllerModule):
|
||||||
"TapName": self._tunnels[tnlid].tap_name,
|
"TapName": self._tunnels[tnlid].tap_name,
|
||||||
"MAC": self._tunnels[tnlid].mac,
|
"MAC": self._tunnels[tnlid].mac,
|
||||||
"PeerMac": self._tunnels[tnlid].peer_mac,
|
"PeerMac": self._tunnels[tnlid].peer_mac,
|
||||||
"Dataplane": self._tunnels[tnlid].dataplane,
|
"Dataplane": DATAPLANE_TYPES.Tincan,
|
||||||
}
|
}
|
||||||
self._link_updates_publisher.post_update(param)
|
self._link_updates_publisher.post_update(param)
|
||||||
elif lnk_status == TUNNEL_STATES.QUERYING:
|
elif lnk_status == TUNNEL_STATES.QUERYING:
|
||||||
|
@ -873,6 +872,7 @@ class LinkManager(ControllerModule):
|
||||||
self.node_id[:7],
|
self.node_id[:7],
|
||||||
peer_id[:7],
|
peer_id[:7],
|
||||||
)
|
)
|
||||||
|
tnl.fpr = None
|
||||||
if not tnl.is_tnl_online():
|
if not tnl.is_tnl_online():
|
||||||
self.register_timed_transaction(
|
self.register_timed_transaction(
|
||||||
tnl,
|
tnl,
|
||||||
|
@ -931,7 +931,8 @@ class LinkManager(ControllerModule):
|
||||||
lnkid = params["LinkId"]
|
lnkid = params["LinkId"]
|
||||||
tnlid = self.tunnel_id(lnkid)
|
tnlid = self.tunnel_id(lnkid)
|
||||||
peer_id = params["NodeData"]["UID"]
|
peer_id = params["NodeData"]["UID"]
|
||||||
self._tunnels[tnlid].link.creation_state = 0xC0
|
tnl = self._tunnels[tnlid]
|
||||||
|
tnl.link.creation_state = 0xC0
|
||||||
self.logger.debug(
|
self.logger.debug(
|
||||||
"Creating link %s to peer %s (4/4 Target)", lnkid[:7], peer_id[:7]
|
"Creating link %s to peer %s (4/4 Target)", lnkid[:7], peer_id[:7]
|
||||||
)
|
)
|
||||||
|
@ -960,6 +961,7 @@ class LinkManager(ControllerModule):
|
||||||
self.node_id[:7],
|
self.node_id[:7],
|
||||||
peer_id[:7],
|
peer_id[:7],
|
||||||
)
|
)
|
||||||
|
tnl.fpr = None
|
||||||
|
|
||||||
def _send_local_cas_to_peer(self, cbt: CBT):
|
def _send_local_cas_to_peer(self, cbt: CBT):
|
||||||
# Create Link: Phase 6 Node A
|
# Create Link: Phase 6 Node A
|
||||||
|
|
|
@ -130,4 +130,4 @@ class OverlayVisualizer(ControllerModule):
|
||||||
self._vis_req_publisher.post_update(None)
|
self._vis_req_publisher.post_update(None)
|
||||||
|
|
||||||
def terminate(self):
|
def terminate(self):
|
||||||
self.logger.info("Controller module terminating")
|
self.logger.info("Controller module terminated")
|
||||||
|
|
|
@ -39,7 +39,7 @@ from typing import Optional, Tuple, Union
|
||||||
|
|
||||||
import broker
|
import broker
|
||||||
import slixmpp
|
import slixmpp
|
||||||
from broker import CACHE_EXPIRY_INTERVAL, PRESENCE_INTERVAL
|
from broker import CACHE_ENTRY_TIMEOUT, PRESENCE_UPDATE_INTERVAL
|
||||||
from broker.cbt import CBT
|
from broker.cbt import CBT
|
||||||
from broker.controller_module import ControllerModule
|
from broker.controller_module import ControllerModule
|
||||||
from broker.remote_action import RemoteAction
|
from broker.remote_action import RemoteAction
|
||||||
|
@ -430,7 +430,7 @@ class XmppCircle:
|
||||||
self.on_net_fail = kwargs["on_net_fail"]
|
self.on_net_fail = kwargs["on_net_fail"]
|
||||||
self._transmission_queues: dict[str, Queue] = {}
|
self._transmission_queues: dict[str, Queue] = {}
|
||||||
self.jid_cache: JidCache = JidCache(
|
self.jid_cache: JidCache = JidCache(
|
||||||
ovl_config.get("CacheExpiry", CACHE_EXPIRY_INTERVAL)
|
ovl_config.get("CacheExpiry", CACHE_ENTRY_TIMEOUT)
|
||||||
)
|
)
|
||||||
self.xport: XmppTransport = None
|
self.xport: XmppTransport = None
|
||||||
self._xport_thread = threading.Thread(
|
self._xport_thread = threading.Thread(
|
||||||
|
@ -516,15 +516,15 @@ class Signal(ControllerModule):
|
||||||
self._circles[olid] = xcir
|
self._circles[olid] = xcir
|
||||||
xcir.start()
|
xcir.start()
|
||||||
self.register_deferred_call(
|
self.register_deferred_call(
|
||||||
PRESENCE_INTERVAL * random.randint(1, 5),
|
PRESENCE_UPDATE_INTERVAL * random.randint(1, 5),
|
||||||
self.on_exp_presence,
|
self.on_exp_presence,
|
||||||
)
|
)
|
||||||
self.logger.info("Controller module loaded")
|
self.logger.info("Controller module loaded")
|
||||||
|
|
||||||
def _next_anc_interval(self) -> float:
|
def _next_anc_interval(self) -> float:
|
||||||
return self.config.get("PresenceInterval", PRESENCE_INTERVAL) * random.randint(
|
return self.config.get(
|
||||||
20, 50
|
"PresenceInterval", PRESENCE_UPDATE_INTERVAL
|
||||||
)
|
) * random.randint(20, 50)
|
||||||
|
|
||||||
def on_exp_presence(self):
|
def on_exp_presence(self):
|
||||||
with self._lck:
|
with self._lck:
|
||||||
|
@ -559,7 +559,7 @@ class Signal(ControllerModule):
|
||||||
self._circles[xcir.overlay_id] = xcir
|
self._circles[xcir.overlay_id] = xcir
|
||||||
xcir.start()
|
xcir.start()
|
||||||
self.register_deferred_call(
|
self.register_deferred_call(
|
||||||
PRESENCE_INTERVAL * random.randint(1, 5),
|
PRESENCE_UPDATE_INTERVAL * random.randint(1, 5),
|
||||||
self.on_exp_presence,
|
self.on_exp_presence,
|
||||||
)
|
)
|
||||||
cbt.set_response(None, True)
|
cbt.set_response(None, True)
|
||||||
|
@ -727,7 +727,7 @@ class Signal(ControllerModule):
|
||||||
with self._lck:
|
with self._lck:
|
||||||
for overlay_id in self._circles:
|
for overlay_id in self._circles:
|
||||||
self._circles[overlay_id].terminate()
|
self._circles[overlay_id].terminate()
|
||||||
self.logger.info("Controller module terminating")
|
self.logger.info("Controller module terminated")
|
||||||
|
|
||||||
def abort_handler(self, cbt: CBT):
|
def abort_handler(self, cbt: CBT):
|
||||||
rem_act = self._recv_remote_acts_invk_locally.pop(cbt.tag, None)
|
rem_act = self._recv_remote_acts_invk_locally.pop(cbt.tag, None)
|
||||||
|
|
|
@ -30,7 +30,7 @@ from copy import deepcopy
|
||||||
from threading import Event
|
from threading import Event
|
||||||
|
|
||||||
import broker
|
import broker
|
||||||
from broker import TINCAN_CHK_INTERVAL
|
from broker import TC_PRCS_CHK_INTERVAL
|
||||||
from broker.cbt import CBT
|
from broker.cbt import CBT
|
||||||
from broker.controller_module import ControllerModule
|
from broker.controller_module import ControllerModule
|
||||||
from broker.process_proxy import ProxyMsg
|
from broker.process_proxy import ProxyMsg
|
||||||
|
@ -84,7 +84,7 @@ class TincanTunnel(ControllerModule):
|
||||||
self._register_resp_handlers()
|
self._register_resp_handlers()
|
||||||
self._register_abort_handlers()
|
self._register_abort_handlers()
|
||||||
self._tci_publisher = self.publish_subscription("TCI_TUNNEL_EVENT")
|
self._tci_publisher = self.publish_subscription("TCI_TUNNEL_EVENT")
|
||||||
self.register_deferred_call(TINCAN_CHK_INTERVAL, self.on_expire_chk_tincan)
|
self.register_deferred_call(TC_PRCS_CHK_INTERVAL, self.on_expire_chk_tincan)
|
||||||
self.logger.info("Controller module loaded")
|
self.logger.info("Controller module loaded")
|
||||||
|
|
||||||
def _register_abort_handlers(self):
|
def _register_abort_handlers(self):
|
||||||
|
@ -374,7 +374,7 @@ class TincanTunnel(ControllerModule):
|
||||||
self.logger.info("Tincan request expired %s", tag)
|
self.logger.info("Tincan request expired %s", tag)
|
||||||
cbt: CBT = self._tnl_cbts.pop(tag, None)
|
cbt: CBT = self._tnl_cbts.pop(tag, None)
|
||||||
if cbt and cbt.is_pending:
|
if cbt and cbt.is_pending:
|
||||||
cbt.set_response("Tincan request expired", False)
|
cbt.set_response("The Tincan request expired", False)
|
||||||
self.complete_cbt(cbt)
|
self.complete_cbt(cbt)
|
||||||
|
|
||||||
def is_tc_req_cmpl(self, tag: int) -> bool:
|
def is_tc_req_cmpl(self, tag: int) -> bool:
|
||||||
|
@ -393,14 +393,14 @@ class TincanTunnel(ControllerModule):
|
||||||
return
|
return
|
||||||
if self._tc_proc_tbl:
|
if self._tc_proc_tbl:
|
||||||
self.register_internal_cbt("_TCI_CHK_PROCESS")
|
self.register_internal_cbt("_TCI_CHK_PROCESS")
|
||||||
self.register_deferred_call(TINCAN_CHK_INTERVAL, self.on_expire_chk_tincan)
|
self.register_deferred_call(TC_PRCS_CHK_INTERVAL, self.on_expire_chk_tincan)
|
||||||
|
|
||||||
def terminate(self):
|
def terminate(self):
|
||||||
self.exit_ev.set()
|
self.exit_ev.set()
|
||||||
for tc_proc in self._tc_proc_tbl.values():
|
for tc_proc in self._tc_proc_tbl.values():
|
||||||
self._stop_tincan(tc_proc, wt=1.5)
|
self._stop_tincan(tc_proc, wt=1.5)
|
||||||
self.logger.debug("avg tok = %s", self._kill_times[-1] / len(self._kill_times))
|
self.logger.debug("avg tok = %s", self._kill_times[-1] / len(self._kill_times))
|
||||||
self.logger.info("Controller module terminating")
|
self.logger.info("Controller module terminated")
|
||||||
|
|
||||||
def send_control(self, ipc_id: int, ctl: str):
|
def send_control(self, ipc_id: int, ctl: str):
|
||||||
msg: ProxyMsg = ProxyMsg(ipc_id, payload=ctl.encode("utf-8"))
|
msg: ProxyMsg = ProxyMsg(ipc_id, payload=ctl.encode("utf-8"))
|
||||||
|
|
|
@ -32,13 +32,13 @@ from typing import Optional
|
||||||
|
|
||||||
import broker
|
import broker
|
||||||
from broker import ( # PEER_DISCOVERY_COALESCE,
|
from broker import ( # PEER_DISCOVERY_COALESCE,
|
||||||
CBT_LIFESPAN,
|
CBT_DFLT_TIMEOUT,
|
||||||
EXCLUSION_BASE_INTERVAL,
|
|
||||||
MAX_CONCURRENT_OPS,
|
MAX_CONCURRENT_OPS,
|
||||||
MAX_ON_DEMAND_EDGES,
|
MAX_ON_DEMAND_EDGES,
|
||||||
MAX_SUCCESSIVE_FAILS,
|
MAX_SUCCESSIVE_FAILS,
|
||||||
MIN_SUCCESSORS,
|
MIN_SUCCESSORS,
|
||||||
STALE_INTERVAL,
|
PEER_CHKIN_TIMEOUT,
|
||||||
|
PEER_EXCLUSION_INTERVAL,
|
||||||
SUCCESSIVE_FAIL_DECR,
|
SUCCESSIVE_FAIL_DECR,
|
||||||
SUCCESSIVE_FAIL_INCR,
|
SUCCESSIVE_FAIL_INCR,
|
||||||
TRIM_CHECK_INTERVAL,
|
TRIM_CHECK_INTERVAL,
|
||||||
|
@ -101,7 +101,7 @@ class DiscoveredPeer:
|
||||||
def exclude(self):
|
def exclude(self):
|
||||||
self.successive_fails += SUCCESSIVE_FAIL_INCR
|
self.successive_fails += SUCCESSIVE_FAIL_INCR
|
||||||
self.available_time = (
|
self.available_time = (
|
||||||
randint(1, 4) * EXCLUSION_BASE_INTERVAL * self.successive_fails
|
randint(1, 4) * PEER_EXCLUSION_INTERVAL * self.successive_fails
|
||||||
) + time.time()
|
) + time.time()
|
||||||
if self.successive_fails >= MAX_SUCCESSIVE_FAILS:
|
if self.successive_fails >= MAX_SUCCESSIVE_FAILS:
|
||||||
self.is_banned = True
|
self.is_banned = True
|
||||||
|
@ -120,7 +120,7 @@ class DiscoveredPeer:
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_stale(self):
|
def is_stale(self):
|
||||||
return bool(time.time() - self.last_checkin >= STALE_INTERVAL)
|
return bool(time.time() - self.last_checkin >= PEER_CHKIN_TIMEOUT)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_available(self):
|
def is_available(self):
|
||||||
|
@ -128,7 +128,7 @@ class DiscoveredPeer:
|
||||||
(not self.is_banned) # successive_fails < max_successive_fails
|
(not self.is_banned) # successive_fails < max_successive_fails
|
||||||
# the falloff wait period is over
|
# the falloff wait period is over
|
||||||
and (time.time() >= self.available_time)
|
and (time.time() >= self.available_time)
|
||||||
and (time.time() - self.last_checkin < STALE_INTERVAL - 600)
|
and (time.time() - self.last_checkin < PEER_CHKIN_TIMEOUT - 600)
|
||||||
) # 10 mins before a node is stale
|
) # 10 mins before a node is stale
|
||||||
|
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ class Topology(ControllerModule):
|
||||||
}
|
}
|
||||||
|
|
||||||
def terminate(self):
|
def terminate(self):
|
||||||
self.logger.info("Controller module terminating")
|
self.logger.info("Controller module terminated")
|
||||||
|
|
||||||
def on_timer_event(self):
|
def on_timer_event(self):
|
||||||
if not self._is_topo_update_pending:
|
if not self._is_topo_update_pending:
|
||||||
|
@ -557,7 +557,7 @@ class Topology(ControllerModule):
|
||||||
(ce, olid),
|
(ce, olid),
|
||||||
self._is_connedge_connected,
|
self._is_connedge_connected,
|
||||||
self._on_connedge_timeout,
|
self._on_connedge_timeout,
|
||||||
CBT_LIFESPAN,
|
CBT_DFLT_TIMEOUT,
|
||||||
)
|
)
|
||||||
self._authorize_incoming_tunnel(
|
self._authorize_incoming_tunnel(
|
||||||
net_ovl,
|
net_ovl,
|
||||||
|
|
|
@ -65,7 +65,7 @@ class UsageReport(ControllerModule):
|
||||||
self.register_cbt("Topology", "TOP_QUERY_KNOWN_PEERS", None)
|
self.register_cbt("Topology", "TOP_QUERY_KNOWN_PEERS", None)
|
||||||
|
|
||||||
def terminate(self):
|
def terminate(self):
|
||||||
self.logger.info("Controller module terminating")
|
self.logger.info("Controller module terminated")
|
||||||
|
|
||||||
def create_report(self, data):
|
def create_report(self, data):
|
||||||
self._report["ReportId"] = self._report_id
|
self._report["ReportId"] = self._report_id
|
||||||
|
|
Loading…
Reference in New Issue