Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

two minor rhsm followups #989

Merged
merged 2 commits into from
Dec 20, 2024
Merged

two minor rhsm followups #989

merged 2 commits into from
Dec 20, 2024

Conversation

cgwalters
Copy link
Collaborator

Followups to #977

This could be its own whole new test, but it's simple
enough to add one here.

Signed-off-by: Colin Walters <[email protected]>
Just noticed this when reading the code; our cap-std-ext crate
has a handy `atomic_write` API which streamlines exactly this
use case. This avoids having a corrupted/half-written facts
file if our process is interrupted, and also avoids a case
where a reading process may temporarily see a half written file.

Signed-off-by: Colin Walters <[email protected]>
OpenOptions::new().write(true).create(true).truncate(true),
)?;
serde_json::to_writer_pretty(&mut bootc_facts_file, &facts)?;
root.atomic_replace_with(FACTS_PATH, |w| {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 TIL!

@jeckersb jeckersb merged commit 95fb311 into containers:main Dec 20, 2024
20 of 25 checks passed
@cgwalters
Copy link
Collaborator Author

Ug, the integration test on this run hit the dreaded

ERROR Switching: Pulling: Importing: Parsing layer blob sha256:8a3d9214708cd83d1dcc9b40fb6363f838bad5e57980cbbcfc5aa50e5b487beb: failed to invoke method FinishPipe: failed to invoke method FinishPipe: write |1: broken pipe

too...

@jeckersb
Copy link
Contributor

Ug, the integration test on this run hit the dreaded

ERROR Switching: Pulling: Importing: Parsing layer blob sha256:8a3d9214708cd83d1dcc9b40fb6363f838bad5e57980cbbcfc5aa50e5b487beb: failed to invoke method FinishPipe: failed to invoke method FinishPipe: write |1: broken pipe

too...

This is the equivalent of getting a stocking full of coal for Christmas. I am not looking forward to fighting this again in 2025!

@cgwalters
Copy link
Collaborator Author

On this topic, I have now marked the integration tests as required.

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.

2 participants