Fix: guard send paths against writing to closed sockets; lower test port bases
Three fixes surfaced while running the E3 integration suite end-to-end: 1. sendMsgOnPairedInbound / sendMsgOnPairedOutbound / TwinLink sendMsgOn* now check isConnected() before calling write(). Without the guard, a heartbeat TX firing between the remote peer dying and our RX-timeout cleanup tripped an "assert sock >= 0" inside Async::TcpConnection::write and crashed the reflector (seen in test_07 as ref2 exiting with SIGSEGV after ref1 was killed). 2. Twin topology trunk_port_base values reduced (45000-48000) so the http-port offset (+3080) stays <= 65535. The earlier 60000-63000 bases produced 66080, which docker compose rejected as an invalid hostPort. 3. Twin reflector names lowercased (refa, refc) to satisfy Docker's image tag constraint (lowercase-only). All 7 integration tests now pass end-to-end: - twin handshake (mutual authenticated hello) - no HMAC/prefix errors on startup - refa's PAIRED=1 trunk reports connected=True - both pair members see TRUNK_IT_DE back to refa - no twin-related ERRORs in startup logs - kill ref2 -> ref1 detects timeout, restart -> re-handshakes - kill ref1 -> refa stays connected to the pair via ref2 (failover)
This commit is contained in:
1 parent
a2b5d448fa
commit
06a2275ee6
4 files changed
+43
-37
No files matched your search
+13
-10
@@ -122,7 +122,7 @@ def first_prefix(prefixes) -> str:
|
||||
# to select this topology without touching the default above.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# 4-reflector mesh: refA (Italy), ref1+ref2 (Germany twin pair), refC (extra)
|
||||
# 4-reflector mesh: refa (Italy), ref1+ref2 (Germany twin pair), refc (extra)
|
||||
#
|
||||
# Keys:
|
||||
# prefix : list of owned prefixes
|
||||
@@ -131,10 +131,13 @@ def first_prefix(prefixes) -> str:
|
||||
# redis : enable Redis config store (optional)
|
||||
TWIN_REFLECTORS = {
|
||||
# name prefixes port-base notes
|
||||
"refA": {"prefix": ["222"], "trunk_port_base": 60000}, # Italy
|
||||
"ref1": {"prefix": ["262"], "trunk_port_base": 61000, "twin_of": "ref2"}, # DE twin 1
|
||||
"ref2": {"prefix": ["262"], "trunk_port_base": 62000, "twin_of": "ref1"}, # DE twin 2
|
||||
"refC": {"prefix": ["333"], "trunk_port_base": 63000}, # extra peer
|
||||
# Port layout: client=base+300, trunk=base+302, twin=base+304, http=base+3080
|
||||
# Must keep http port <= 65535, so base <= ~62000.
|
||||
# Names must be lowercase (Docker image tag constraint).
|
||||
"refa": {"prefix": ["222"], "trunk_port_base": 45000}, # Italy
|
||||
"ref1": {"prefix": ["262"], "trunk_port_base": 46000, "twin_of": "ref2"}, # DE twin 1
|
||||
"ref2": {"prefix": ["262"], "trunk_port_base": 47000, "twin_of": "ref1"}, # DE twin 2
|
||||
"refc": {"prefix": ["333"], "trunk_port_base": 48000}, # extra peer
|
||||
}
|
||||
|
||||
# Explicit trunk list for the twin topology.
|
||||
@@ -145,24 +148,24 @@ TWIN_REFLECTORS = {
|
||||
# pair_members : the subset of peers that form the twin pair (needed to split sides)
|
||||
#
|
||||
# For a paired trunk the rule is:
|
||||
# - non-pair side (refA): [TRUNK_IT_DE] HOST=ref1,ref2 PAIRED=1
|
||||
# - pair members (ref1, ref2): [TRUNK_IT_DE] HOST=refA (normal, no PAIRED)
|
||||
# - non-pair side (refa): [TRUNK_IT_DE] HOST=ref1,ref2 PAIRED=1
|
||||
# - pair members (ref1, ref2): [TRUNK_IT_DE] HOST=refa (normal, no PAIRED)
|
||||
TWIN_TRUNKS = [
|
||||
{
|
||||
"name": "IT_DE",
|
||||
"peers": ["refA", "ref1", "ref2"],
|
||||
"peers": ["refa", "ref1", "ref2"],
|
||||
"paired": True,
|
||||
"pair_members": ["ref1", "ref2"],
|
||||
},
|
||||
{
|
||||
"name": "IT_C",
|
||||
"peers": ["refA", "refC"],
|
||||
"peers": ["refa", "refc"],
|
||||
"paired": False,
|
||||
"pair_members": [],
|
||||
},
|
||||
{
|
||||
"name": "DE_C",
|
||||
"peers": ["ref1", "ref2", "refC"],
|
||||
"peers": ["ref1", "ref2", "refc"],
|
||||
"paired": True,
|
||||
"pair_members": ["ref1", "ref2"],
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user