Skip to content

Commit 39c06eb

Browse files
Frandoclaude
andcommitted
fix: make conntrack flush best-effort when conntrack binary is missing
CI environments may not have the conntrack binary installed. The flush is a performance optimization, not a correctness requirement. Log and continue instead of returning an error. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 155c113 commit 39c06eb

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

patchbay/src/balancer.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -666,16 +666,20 @@ impl crate::router::Router {
666666
&port.to_string(),
667667
])
668668
.status()
669-
.await
670-
.context("spawn conntrack -D")?;
671-
// conntrack -D returns non-zero if no entries matched, which is fine.
672-
debug!(
673-
vip = %vip,
674-
port = %port,
675-
proto = %proto,
676-
success = status.success(),
677-
"balancer: conntrack flush"
678-
);
669+
.await;
670+
// conntrack may not be installed or may find no matching entries.
671+
// Both are fine. Log and continue.
672+
match status {
673+
Ok(s) => debug!(
674+
vip = %vip, port = %port, proto = %proto,
675+
success = s.success(),
676+
"balancer: conntrack flush"
677+
),
678+
Err(e) => debug!(
679+
error = %e,
680+
"balancer: conntrack not available, skipping flush"
681+
),
682+
}
679683
}
680684
Ok(())
681685
};

0 commit comments

Comments
 (0)