Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

moca-egress: async bounded audit, and bounded conn_cap refusals per VM

Open
#586 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
go

Research direction

Read the #583 review discussion linked in the issue, then trace Audit.Emit, Unregister, abort(), and Close to see how audit writes interact with the proxy control socket. The issue proposes a bounded async audit queue with drop reporting, plus per-VM bounds and coalescing for conn_cap refusals. Done means audit stalls no longer block proxy operations and refusal handling stays bounded as described.

Written by the indexing model from the issue text.

Description

Follow-up from the #583 review (comment https://github.com/rossoctl/moca/pull/583#discussion_r4348544861), 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.

Related: #277, #583.

Dominant language
TypeScript
Stars
4
Forks
9
Avg merge
9h 31m
Merged PRs (30d)
139

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rossoctl/moca

All issues in rossoctl/moca

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.