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

libpod: correctly pass env so alternative locales work #19635

Merged
merged 5 commits into from
Aug 17, 2023

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Aug 15, 2023

see commits

Does this PR introduce a user-facing change?

Fixes containers/conmon#272

Fix a bug where locales weren't passed to conmon correctly, resulting in a crash if some characters were specified over CLI

@openshift-ci openshift-ci bot added release-note approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 15, 2023
@haircommander
Copy link
Collaborator

thanks for taking it over!

@TomSweeneyRedHat
Copy link
Member

Changes look OK, but the test results aren't very happy.

Luap99 added a commit to Luap99/conmon that referenced this pull request Aug 16, 2023
Error messages should always be logged to stderr not stdout.
I found this while working on:
containers/podman#19635

Signed-off-by: Paul Holzinger <[email protected]>
haircommander pushed a commit to containers/conmon that referenced this pull request Aug 16, 2023
Error messages should always be logged to stderr not stdout.
I found this while working on:
containers/podman#19635

Signed-off-by: Paul Holzinger <[email protected]>
@edsantiago
Copy link
Member

I feel a great disturbance in the Force, as if @Luap99 were crying out in despair, bitterly regretting having taken over this PR...

@haircommander
Copy link
Collaborator

I feel a great disturbance in the Force, as if @Luap99 were crying out in despair, bitterly regretting having taken over this PR...

He finally freed me! 🤸 I am very grateful

@Luap99
Copy link
Member Author

Luap99 commented Aug 17, 2023

Well the bug fix is valid and was already working but once again I thought I should test it right.
And with the tests it is clear that this flakes heavily and that the podman conmon startup code is racy and does not handle conmon errors well.

in addition to containers@b6167ce
we also need to pass LANG. Do so, and add a test to verify

Signed-off-by: Peter Hunt <[email protected]>
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -162,10 +162,7 @@ func (r *ConmonOCIRuntime) moveConmonToCgroupAndSignal(ctr *Container, cmd *exec
}

/* We set the cgroup, now the child can start creating children */
if err := writeConmonPipeData(startFd); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

I think there's a linter to catch such cases. Not sure whether it's enabled though.

Copy link
Member Author

Choose a reason for hiding this comment

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

clearly not otherwise it should have flagged this one

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 17, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99, vrothberg

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mheon
Copy link
Member

mheon commented Aug 17, 2023

LGTM. I'll apply an optimistic lgtm/hold in the hopes that CI is satisfied.
/lgtm
/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 17, 2023
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 17, 2023
Luap99 added a commit to Luap99/automation_images that referenced this pull request Aug 17, 2023
A podman test depends on that locale so we need to make it is installed
in the image, see containers/podman#19635.

Signed-off-by: Paul Holzinger <[email protected]>
Luap99 added a commit to Luap99/automation_images that referenced this pull request Aug 17, 2023
Make sure the en_US.UTF-8 LANG is installed and can be used by podman
tests, see containers/podman#19635.

Signed-off-by: Paul Holzinger <[email protected]>
We need to actually check the output not just exit codes. While doing
this it was clear that the first test was not checking what it should
be so I had to remove the quotes from the arg.

Also this check did not work with remote testing at all, we must set the
env then restart the server as the env for conmon must be set on the
server obviously.
Also we can only match the conmon error messages on the local client.

Lastly this test requires the journald driver but we cannot use the in
container tests so skip it there.

Signed-off-by: Paul Holzinger <[email protected]>
Make sure the en_US.UTF-8 locale is available so that we can use it in
tests, namely "podman logs with non ASCII log tag succeeds with env".

It is already there in fedora (except container image but we cannot use
journald there anyway) so only do this for debian. I think it makes
most sense to move this into the image build process in the future to
only do it once at build time.

Signed-off-by: Paul Holzinger <[email protected]>
When conmon is started it blocks and waits for us to signal it to start
via pipe. This works but when conmon exits before it waits for the start
message it causes podman to fail with `write child: broken pipe`. This
error is meaningless to podman users.

The real error is that conmon failed so we should not return early if we
fail to send the start message to conmon. Instead ignore the EPIPE error
case as it is safe to assume to the conmon died and for other errors we
make sure to kill conmon so that the following wait() call does not hang
forever. This also fixes problems with having conmon zombie processes
leaked as wait() was never called.

Signed-off-by: Paul Holzinger <[email protected]>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 17, 2023
@Luap99
Copy link
Member Author

Luap99 commented Aug 17, 2023

Ok, now it should work. I tried for far to long to get this working in the in container tests until I realized that this requires the journald driver and we have no systemd running there so it will never work.

@Luap99
Copy link
Member Author

Luap99 commented Aug 17, 2023

I feel a great disturbance in the Force, as if @Luap99 were crying out in despair, bitterly regretting having taken over this PR...

I don't regret it, the funny answer why I took this over:
image

German speakers will understand this, for those who don't: The missing letter is "ß" for "scheiß" which means fuck in this context. As a german native I can tell you the amount of software that still does not get it right today is to big so I decided podman shouldn't be on that list.

@baude
Copy link
Member

baude commented Aug 17, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 17, 2023
@edsantiago
Copy link
Member

/hold cancel

My last name is Santiago Muñoz; the space is part of it, so is the enye (n-tilde). I can count on one finger the number of databases I'm in that get it right.

I am thankful for ISO-8859-1 and UTF-8, and welcome all efforts to improve i18n handling. Thank you @Luap99.

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 17, 2023
@openshift-merge-robot openshift-merge-robot merged commit 938a3e1 into containers:main Aug 17, 2023
89 checks passed
@Luap99 Luap99 deleted the utf8-log-tag branch August 17, 2023 16:37
Luap99 added a commit to Luap99/automation_images that referenced this pull request Aug 21, 2023
Make sure the en_US.UTF-8 LANG is installed and can be used by podman
tests, see containers/podman#19635.

Signed-off-by: Paul Holzinger <[email protected]>
Luap99 added a commit to Luap99/automation_images that referenced this pull request Aug 21, 2023
Make sure the en_US.UTF-8 LANG is installed and can be used by podman
tests, see containers/podman#19635.

Signed-off-by: Paul Holzinger <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Nov 16, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[logging] multibyte-characters break input conversion
8 participants