Skip to content

cgroup: skip empty Docker BlockIO when blkio controller is missing - #14763

Merged
copybara-service[bot] merged 1 commit into
gvisor:masterfrom
adi-IL:fix/cgroup-skip-empty-blockio
Nov 14, 2026
Merged

copybara-service[bot] merged 1 commit into
gvisor:masterfrom
adi-IL:fix/cgroup-skip-empty-blockio

Conversation

@adi-IL

@adi-IL adi-IL commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Description

blockIO.skip currently fails whenever spec.BlockIO != nil, even if every
field is the zero/empty default. Docker always populates blockIO (as {}
or {"weight":0}) when no I/O limits are requested, so runsc fails to start
on hosts that lack the blkio cgroup controller (CONFIG_BLK_CGROUP=n).

This change mirrors the cpuset optional-controller pattern: skip when BlockIO
is nil/empty/weight-0, and still error when real limits are set.

Fixes #14738

AI disclosure

Assisted-by: Cursor Agent. I reviewed and validated the change against the
issue reproducer and the existing TestOptional coverage.

Testing

  • Extended TestOptional blkio case with extraValid entries for Docker 29
    empty BlockIO and Docker <=24 Weight=0.
  • Existing invalid-weight case still expects the missing-controller error.

@github-actions
github-actions Bot requested review from carzh and fvoznika September 15, 2026 16:16
Docker always emits a BlockIO object even when no I/O limits are set
(empty object, or Weight=0). Treat those as "no limits" so runsc can
start on hosts without CONFIG_BLK_CGROUP.

Fixes gvisor#14738

Assisted-by: Cursor Agent
@adi-IL
adi-IL force-pushed the fix/cgroup-skip-empty-blockio branch from d8a47bd to f3eee18 Compare September 15, 2026 18:26
@adi-IL

adi-IL commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

This is ready for review when someone has a moment. Happy to make any changes.

@EtiennePerot EtiennePerot added the ready to pull Causes the PR to be imported into Google. Will be removed soon. label Nov 3, 2026
@EtiennePerot EtiennePerot added ready to pull Causes the PR to be imported into Google. Will be removed soon. and removed ready to pull Causes the PR to be imported into Google. Will be removed soon. labels Nov 10, 2026
copybara-service Bot pushed a commit that referenced this pull request Nov 13, 2026
### Description

`blockIO.skip` currently fails whenever `spec.BlockIO != nil`, even if every
field is the zero/empty default. Docker always populates `blockIO` (as `{}`
or `{"weight":0}`) when no I/O limits are requested, so runsc fails to start
on hosts that lack the blkio cgroup controller (`CONFIG_BLK_CGROUP=n`).

This change mirrors the cpuset optional-controller pattern: skip when BlockIO
is nil/empty/weight-0, and still error when real limits are set.

Fixes #14738

### AI disclosure

Assisted-by: Cursor Agent. I reviewed and validated the change against the
issue reproducer and the existing `TestOptional` coverage.

### Testing

- Extended `TestOptional` blkio case with `extraValid` entries for Docker 29
  empty BlockIO and Docker <=24 `Weight=0`.
- Existing invalid-weight case still expects the missing-controller error.
Auto-fixed-by: [🤖] @EtiennePerot
FUTURE_COPYBARA_INTEGRATE_REVIEW=#14763 from adi-IL:fix/cgroup-skip-empty-blockio f3eee18
PiperOrigin-RevId: 1019799700
copybara-service Bot pushed a commit that referenced this pull request Nov 13, 2026
### Description

`blockIO.skip` currently fails whenever `spec.BlockIO != nil`, even if every
field is the zero/empty default. Docker always populates `blockIO` (as `{}`
or `{"weight":0}`) when no I/O limits are requested, so runsc fails to start
on hosts that lack the blkio cgroup controller (`CONFIG_BLK_CGROUP=n`).

This change mirrors the cpuset optional-controller pattern: skip when BlockIO
is nil/empty/weight-0, and still error when real limits are set.

Fixes #14738

### AI disclosure

Assisted-by: Cursor Agent. I reviewed and validated the change against the
issue reproducer and the existing `TestOptional` coverage.

### Testing

- Extended `TestOptional` blkio case with `extraValid` entries for Docker 29
  empty BlockIO and Docker <=24 `Weight=0`.
- Existing invalid-weight case still expects the missing-controller error.
Auto-fixed-by: [🤖] @EtiennePerot
FUTURE_COPYBARA_INTEGRATE_REVIEW=#14763 from adi-IL:fix/cgroup-skip-empty-blockio f3eee18
PiperOrigin-RevId: 1019799700
copybara-service Bot pushed a commit that referenced this pull request Nov 13, 2026
### Description

`blockIO.skip` currently fails whenever `spec.BlockIO != nil`, even if every
field is the zero/empty default. Docker always populates `blockIO` (as `{}`
or `{"weight":0}`) when no I/O limits are requested, so runsc fails to start
on hosts that lack the blkio cgroup controller (`CONFIG_BLK_CGROUP=n`).

This change mirrors the cpuset optional-controller pattern: skip when BlockIO
is nil/empty/weight-0, and still error when real limits are set.

Fixes #14738

### AI disclosure

Assisted-by: Cursor Agent. I reviewed and validated the change against the
issue reproducer and the existing `TestOptional` coverage.

### Testing

- Extended `TestOptional` blkio case with `extraValid` entries for Docker 29
  empty BlockIO and Docker <=24 `Weight=0`.
- Existing invalid-weight case still expects the missing-controller error.
Auto-fixed-by: [🤖] @EtiennePerot
FUTURE_COPYBARA_INTEGRATE_REVIEW=#14763 from adi-IL:fix/cgroup-skip-empty-blockio f3eee18
PiperOrigin-RevId: 1019799700
copybara-service Bot pushed a commit that referenced this pull request Nov 13, 2026
### Description

`blockIO.skip` currently fails whenever `spec.BlockIO != nil`, even if every
field is the zero/empty default. Docker always populates `blockIO` (as `{}`
or `{"weight":0}`) when no I/O limits are requested, so runsc fails to start
on hosts that lack the blkio cgroup controller (`CONFIG_BLK_CGROUP=n`).

This change mirrors the cpuset optional-controller pattern: skip when BlockIO
is nil/empty/weight-0, and still error when real limits are set.

Fixes #14738

### AI disclosure

Assisted-by: Cursor Agent. I reviewed and validated the change against the
issue reproducer and the existing `TestOptional` coverage.

### Testing

- Extended `TestOptional` blkio case with `extraValid` entries for Docker 29
  empty BlockIO and Docker <=24 `Weight=0`.
- Existing invalid-weight case still expects the missing-controller error.
Auto-fixed-by: [🤖] @EtiennePerot
FUTURE_COPYBARA_INTEGRATE_REVIEW=#14763 from adi-IL:fix/cgroup-skip-empty-blockio f3eee18
PiperOrigin-RevId: 1019799700
copybara-service Bot pushed a commit that referenced this pull request Nov 14, 2026
### Description

`blockIO.skip` currently fails whenever `spec.BlockIO != nil`, even if every
field is the zero/empty default. Docker always populates `blockIO` (as `{}`
or `{"weight":0}`) when no I/O limits are requested, so runsc fails to start
on hosts that lack the blkio cgroup controller (`CONFIG_BLK_CGROUP=n`).

This change mirrors the cpuset optional-controller pattern: skip when BlockIO
is nil/empty/weight-0, and still error when real limits are set.

Fixes #14738

### AI disclosure

Assisted-by: Cursor Agent. I reviewed and validated the change against the
issue reproducer and the existing `TestOptional` coverage.

### Testing

- Extended `TestOptional` blkio case with `extraValid` entries for Docker 29
  empty BlockIO and Docker <=24 `Weight=0`.
- Existing invalid-weight case still expects the missing-controller error.
Auto-fixed-by: [🤖] @EtiennePerot
FUTURE_COPYBARA_INTEGRATE_REVIEW=#14763 from adi-IL:fix/cgroup-skip-empty-blockio f3eee18
PiperOrigin-RevId: 1019799700
@copybara-service
copybara-service Bot merged commit e45d53c into gvisor:master Nov 14, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to pull Causes the PR to be imported into Google. Will be removed soon.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

runsc Doesn't Skip Empty BlockIO

3 participants