Skip to content

Conversation

@jnovy
Copy link
Collaborator

@jnovy jnovy commented Sep 8, 2025

Generates terminating F-sequence when container exits with partial log output.

Fixes #252

@jnovy jnovy requested a review from giuseppe September 8, 2025 10:09
Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

codewise LGTM, can't comment on the CRI interface.

@haircommander PTAL

@jnovy jnovy requested a review from haircommander September 8, 2025 10:38

# If log is empty, this means containers aren't working in test environment
# In that case, just verify that the fix code exists in the source
if [ -z "$log_content" ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't love this, as we'll miss misbehaving conmon if we do this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Indeed! I will change it to be more focused.

} else if (writev_buffer_append_segment(k8s_log_fd, &bufv, "F\n", 2) < 0) {
nwarn("failed to write terminating F-sequence");
} else {
k8s_bytes_written += TSBUFLEN - 1 + 2;
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm in the case where we succeed in the first branch but fail in the second, I don't think we'd get here but we did write TSBUFLEN - 1 to the buffer. I think your branching strategy is slick but maybe not completely accurate and it could be simplified to be a bit clearer what's going on. it took me a moment to understand

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will change the logic to use bools, not if/else to be more transparent.

Generates terminating F-sequence when container exits with partial log output.

Fixes containers#252

Signed-off-by: Jindrich Novy <jnovy@redhat.com>
@jnovy jnovy requested a review from haircommander September 9, 2025 05:22
@jnovy jnovy merged commit e25af44 into containers:main Sep 10, 2025
34 checks passed
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.

Missing "<timestamp> stdout F" in container log if container terminates without writing a linebreak

3 participants