Skip to content

libct: drop "from parent" from generic sync errors - #5433

Merged
cyphar merged 1 commit into
opencontainers:mainfrom
kolyshkin:sync-error-wording
Sep 3, 2026
Merged

cyphar merged 1 commit into
opencontainers:mainfrom
kolyshkin:sync-error-wording

Conversation

@kolyshkin

@kolyshkin kolyshkin commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

A drive-by spotted while working on #5431. TL;DR: correct (less confusing) error messages.

doReadSync's two error messages name a side:

return sync, fmt.Errorf("reading from parent failed: %w", err)
...
return sync, fmt.Errorf("unmarshal sync from parent failed: %w", err)

That used to be true. They arrive from 4776b43 ("libcontainer: refactor syncT handling", 2016), the commit that added libcontainer/sync.go, where readSync existed for runc init alone — reading what the parent had sent. Its sibling wording (invalid synchronisation flag from parent) was equally correct.

f81ef14 ("libcontainer: sync: cleanup synchronisation code", 2023) split readSync into doReadSync plus wrappers, and doReadSync now serves both sides: the child through readSync/readSyncFull, the parent through parseSync. The text came along unchanged. So a read failure on the parent side has, since then, reported that runc could not read from its parent — while it was reading from runc init:

runc run failed: unable to start container process: error during container init: reading from parent failed: ...

Just drop the side; neither message needs it.

These messages date back to 4776b43 ("libcontainer: refactor syncT
handling"), which added libcontainer/sync.go. Its readSync was used by
"runc init" only, to read what its parent had sent, so saying "parent"
was accurate.

f81ef14 ("libcontainer: sync: cleanup synchronisation code") split
readSync into doReadSync plus a few wrappers, and doReadSync now serves
both sides: the child reaches it through readSync/readSyncFull, and the
parent through parseSync. The wording was carried over unchanged, so
ever since, a read error on the parent side claims runc failed to read
from its parent, while it was in fact reading from "runc init".

Both messages are equally clear without naming a side.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@cyphar cyphar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. To be honest, I think I added these to aid in debugging way back then and ended up leaving them there.

@cyphar
cyphar merged commit 0f96272 into opencontainers:main Sep 3, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants