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

Fix api log file increases indefinitely #288

Merged

Conversation

Akrog
Copy link
Contributor

@Akrog Akrog commented Jun 20, 2024

The manila-api pod uses a file between the manila-api service and a sidecar to pass the manila logs from the service to the stdout.

With the current code it will grow forever, which makes no sense, since the stdout from the pod itself is already being stored, under /var/log/pods and/or in a centralized logging service.

This patch makes the oslo.log service rotate the log file once it reaches 20MB in size.

Other projects like nova and glance set the limit to 50MB and they keep 5 rotated files, but I think that keeping rotated files is useless here and 50MB seems a bit much.

Unfortunately we need to at least keep 1 copy, or oslo.log will not do the right thing if set to 0.

We also need to redirect errors in the sidecar container that tails the log to /dev/null to prevent tail error messages whenever the file gets rotated.

@openshift-ci openshift-ci bot requested review from stuggi and viroel June 20, 2024 18:27
@Akrog
Copy link
Contributor Author

Akrog commented Jun 21, 2024

/retest

@fmount
Copy link
Collaborator

fmount commented Jun 22, 2024

I think we should update [1] to make kuttl pass.

[1] https://github.com/openstack-k8s-operators/manila-operator/blob/main/test/kuttl/tests/manila-tls/03-assert.yaml#L259

The manila-api pod uses a file between the manila-api service and a
sidecar to pass the manila logs from the service to the stdout.

With the current code it will grow forever, which makes no sense, since
the stdout from the pod itself is already being stored, under
/var/log/pods and/or in a centralized logging service.

This patch makes the oslo.log service rotate the log file once it
reaches 20MB in size.

Other projects like nova and glance set the limit to 50MB and they keep
5 rotated files, but I think that keeping rotated files is useless here
and 50MB seems a bit much.

Unfortunately we need to at least keep 1 copy, or oslo.log will not do
the right thing if set to 0.

We also need to redirect errors in the sidecar container that tails the
log to /dev/null to prevent tail error messages whenever the file gets
rotated.
@Akrog Akrog force-pushed the fix-api-logfile branch from 94c55ac to fc1f9c0 Compare June 26, 2024 12:50
Copy link
Collaborator

@fmount fmount left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Contributor

openshift-ci bot commented Jun 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Akrog, fmount

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

@openshift-merge-bot openshift-merge-bot bot merged commit fa69b45 into openstack-k8s-operators:main Jun 27, 2024
9 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.

2 participants