Skip to content

Make shadow limit configurable with bounds#63

Open
ArBin1020 wants to merge 1 commit intosysprog21:mainfrom
ArBin1020:dev
Open

Make shadow limit configurable with bounds#63
ArBin1020 wants to merge 1 commit intosysprog21:mainfrom
ArBin1020:dev

Conversation

@ArBin1020
Copy link
Copy Markdown

@ArBin1020 ArBin1020 commented Apr 23, 2026

Address the inherent 256MB capacity limitation on shadow FDs

  • CLI Configurability: Introduced the --shadow-limit option. The default remains 256MB to preserve existing behavior, but users can now raise it for specific workloads.
  • Host OOM Prevention: Enforced a hard upper bound (MAX_SHADOW_LIMIT = 512MB). Inputs exceeding this bound are automatically clamped to 512MB.
  • Type Safety for Parsing: Migrated the internal limit representation to uint64_t to prevent integer wraparound and overflow when handling custom CLI inputs.
  • Input Validation: Clamp negative inputs to MAX_SHADOW_LIMIT, and reject invalid or >64-bit strings with an error.

Change-Id: I814b9edb6b17b0cf3762cc95938410ecbb577f8c


Summary by cubic

Add a configurable shadow FD size limit via the new --shadow-limit flag. Default stays 256MB; values above the 512MB hard cap are clamped to prevent host OOM.

  • New Features
    • --shadow-limit BYTES to raise the shadow FD cap (0 keeps default).
    • Hard max of 512MB; higher inputs are clamped. Invalid values are rejected.
    • Limits use uint64_t for safe parsing and comparisons.

Written for commit 0000edd. Summary will update on new commits.

Address the inherent 256MB capacity limitation on shadow FDs

- CLI Configurability: Introduced the --shadow-limit option. The
  default remains 256MB to preserve existing behavior, but users
  can now raise it for specific workloads.
- Host OOM Prevention: Enforced a hard upper bound (MAX_SHADOW_LIMIT
  = 512MB). Inputs exceeding this bound are automatically clamped to
  512MB.
- Type Safety for Parsing: Migrated the internal limit representation
  to uint64_t to prevent integer wraparound and overflow when
  handling custom CLI inputs.
- Input Validation: Clamp negative inputs to MAX_SHADOW_LIMIT, and
  reject invalid or >64-bit strings with an error.

Change-Id: I814b9edb6b17b0cf3762cc95938410ecbb577f8c
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant