You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
moca-egress: async bounded audit, and bounded conn_cap refusals per VM #586
Follow-up from the #583 review (comment #583 (comment)), deferred out of that PR by agreement.
1. Cap refusals are unbounded. Each connection over MOCA_EGRESS_MAX_CONNS_PER_VM emits a conn_cap audit line and spawns a goroutine that holds the socket for up to ~2 s (writeAndClose: 1 s write plus 1 s drain). A guest connecting in a tight loop can:
exhaust host-wide fds in this single shared process (LimitNOFILE=65536);
flood stdout, so that journald's per-service rate limit (default 10000/30 s) drops other VMs' audit events.
Proposed: bound concurrent cap refusals per VM (close without drain on overflow), and coalesce conn_cap events per VM per interval.
2. Audit can stall the proxy.Audit.Emit writes synchronously to stdout and is called under pc.mu, including from abort() via Unregister. A stalled journald therefore blocks Unregister and Close, and with them the control socket. That contradicts the "auditing must not stall the proxy" comment.
Proposed: a bounded async queue with a drop counter, plus a periodic audit_dropped event when anything was dropped.
Activity
fix(egress): bound cap refusals and stop audit stalling the proxy
Fix(egress): bound established connections in time on both data paths