Skip to content

Conversation

@nalind
Copy link
Member

@nalind nalind commented Aug 18, 2021

When reading log entries from the journal, don't skip past the first matching entry after we've positioned the cursor at it.

Fixes #11253.

@vrothberg
Copy link
Member

vrothberg commented Aug 18, 2021

LGTM

I have changed my opinion also since the meeting. I think that #10653 would actually pass when using c/common v0.43.2.

@nalind
Copy link
Member Author

nalind commented Aug 18, 2021

Hmm, when I run tests manually in my VM, some of them are still failing. This might require some tweaking yet.

@vrothberg
Copy link
Member

@nalind, could you pick up https://github.com/containers/podman/pull/10653/files and bump c/common?

@nalind
Copy link
Member Author

nalind commented Aug 18, 2021

Hmm, when I run tests manually in my VM, some of them are still failing. This might require some tweaking yet.

Oof, that wasn't with this PR, but it looked better locally once I'd checked out the pull request.

@nalind, could you pick up https://github.com/containers/podman/pull/10653/files and bump c/common?

Okay, I think that's in here now.

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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 18, 2021

[APPROVALNOTIFIER] This PR is APPROVED

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

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

The pull request process is described here

Details 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 18, 2021
@nalind
Copy link
Member Author

nalind commented Aug 18, 2021

That extra blank entry that #10653 is adding when each container starts seems to be in conflict here.

@nalind nalind force-pushed the journal-read branch 2 times, most recently from 1c718f6 to 0a04558 Compare August 18, 2021 18:26
@nalind
Copy link
Member Author

nalind commented Aug 18, 2021

Let's see what happens when we make that first entry a "history" event.

@mheon
Copy link
Member

mheon commented Aug 18, 2021

One failure looks like a potential network flake

@nalind
Copy link
Member Author

nalind commented Aug 18, 2021

My test system had events_logger = "file" set in /usr/share/containers/containers.conf, which was causing the podman logs - multi journald test to fail.

@edsantiago
Copy link
Member

This is a real error caused by the new c/common:

$ podman tag 961769676411f082461f9ef46626dd7a2d1e2b2a38e6a44364bcbecf51e66dd4 quay.io/libpod/alpine@sha256:634a8f35b5f16dcf4aaa0822adc0b1964bb786fca12f6831de8ddc45e5986a00
Error: quay.io/libpod/alpine@sha256:634a8f35b5f16dcf4aaa0822adc0b1964bb786fca12f6831de8ddc45e5986a00: tag by digest not supported

@nalind
Copy link
Member Author

nalind commented Aug 18, 2021

This is a real error caused by the new c/common:

$ podman tag 961769676411f082461f9ef46626dd7a2d1e2b2a38e6a44364bcbecf51e66dd4 quay.io/libpod/alpine@sha256:634a8f35b5f16dcf4aaa0822adc0b1964bb786fca12f6831de8ddc45e5986a00
Error: quay.io/libpod/alpine@sha256:634a8f35b5f16dcf4aaa0822adc0b1964bb786fca12f6831de8ddc45e5986a00: tag by digest not supported

Oh, I don't think we're supposed to be able to "tag" images with names that don't include tags (a.k.a. tagged references). I wrote that test, so I guess it's fitting that I get to fix it.

@TomSweeneyRedHat
Copy link
Member

LGTM once the flake bit is hunted down.

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
/hold

Great work, @nalind (and @rhatdan!).

@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 19, 2021
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 19, 2021
@vrothberg
Copy link
Member

The failure in the system tests seems consistent but only on sys remote ubuntu-2104 root host.

[+0491s] not ok 149 podman kill - test signal handling in containers

Not sure what to do other than rebasing and trying again?

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 19, 2021
@nalind
Copy link
Member Author

nalind commented Aug 19, 2021

Rebased.

rhatdan and others added 5 commits August 23, 2021 17:59
[NO TESTS NEEDED] Since we are just testing the default.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
When reading log entries from the journal, don't skip past the first
matching entry after we've positioned the cursor at it.

Make the first blank-line entry that we logged so that the container
would always have at least one log entry for us to find (until it gets
vacuumed out, at least) a fake history entry, so that `logs` doesn't
pass it on for display.

CI already has tests that exercise journal-based logging, so
[NO TESTS NEEDED]

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Update github.com/containers/common from 0.43.0 to 0.43.2.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
In these tests, don't try to tag an image using a canonical ("with
digest") image name.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
In libpod/logs.LogLine.Write(), don't write a newline to stdout/stderr
when the log message is only part of a line.

In libpod.ConmonOCIRuntime.HTTPAttach(), don't send a newline over the
HTTP connection when the log message is only part of a line.

In pkg/api/handlers/compat.LogsFromContainer(), don't send a newline
over the HTTP connection when the log message is only part of a line,
and don't make doing so conditional on whether or not the client used
the docker or podman endpoint.

In pkg/domain/infra/tunnel.ContainerEngine.ContainerLogs(), don't add
our own newline to log messages, since they already come through from
the server when they need to.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 23, 2021
Increase the amount of time we're willing to wait for a log message that
a container should be printing to show up in the output of `logs -f`,
since on at least one CI configuration we're seeing a turnaround as high
as 46s, but it's not something we can directly control, so that's not a
hard maximum.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
@nalind
Copy link
Member Author

nalind commented Aug 24, 2021

The logs: adjust handling around partial log messages commit changes how the HTTP logs handler works. The previous behavior didn't correctly handle cases where a container was outputting one character at a time (for example if the container was a shell sitting at a shell prompt and a person was typing) - the client would receive each logged character as if it were a different line of output. But I'd appreciate a nod from people who are more familiar with it.

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

@containers/podman-maintainers PTAL on the new changes.

@vrothberg
Copy link
Member

@Luap99 PTAL

@vrothberg
Copy link
Member

Note: once merged, we can close #10587

// Log lines in the compat layer require adding EOL
// https://github.com/containers/podman/issues/8058
if !utils.IsLibpodRequest(r) {
if !line.Partial() {
Copy link
Member

Choose a reason for hiding this comment

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

Does this match docker?

Copy link
Member Author

Choose a reason for hiding this comment

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

We use the same handler for both types of clients, so this makes both behave the same. Anecdotally, when I pointed a docker client at the podman socket, I get what looks like the correct behavior on the client end.

@Luap99
Copy link
Member

Luap99 commented Aug 24, 2021

This is a breaking change for API users. Therefore this should not be backported to any 3.X branches. I am fine to merge this since we are on 4.0 on main but this should be documented somewhere.

@vrothberg
Copy link
Member

This is a breaking change for API users. Therefore this should not be backported to any 3.X branches. I am fine to merge this since we are on 4.0 on main but this should be documented somewhere.

Unless it's a bug fix :) Let's explore what Docker does.

@Luap99
Copy link
Member

Luap99 commented Aug 24, 2021

This is a breaking change for API users. Therefore this should not be backported to any 3.X branches. I am fine to merge this since we are on 4.0 on main but this should be documented somewhere.

Unless it's a bug fix :) Let's explore what Docker does.

The log change is not really a bug fix. The new lines are now added on the server side and not on the client side for the libpod endpoint. Therefore this is breaking libpod api users.

@vrothberg
Copy link
Member

/hold cancel

Great work, @nalind and @rhatdan!

@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 24, 2021
Copy link
Member

@ashley-cui ashley-cui left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 24, 2021
@openshift-merge-robot openshift-merge-robot merged commit 23f9565 into containers:main Aug 24, 2021
@nalind nalind deleted the journal-read branch August 24, 2021 18:16
@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 Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rhel9 + log-driver=journald : missing first line

9 participants