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

bug(AMI): Log Rotation Issue Causes Message Fragmentation #2098

Open
mikheevsv opened this issue Dec 24, 2024 · 0 comments
Open

bug(AMI): Log Rotation Issue Causes Message Fragmentation #2098

mikheevsv opened this issue Dec 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mikheevsv
Copy link

What happened: We are experiencing an issue with log rotation where lengthy log messages are being split between two different log files. This results in fragmented and incomplete log entries.

What you expected to happen: Log messages should be complete and not split between log files

How to reproduce it (as minimally and precisely as possible):
For testing, I just run the following python-script on EKS:

import time
message = "0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 "
i = 1
while i < 10000000:
  i += 1
  print(message)
time.sleep(3600)

And changed containerLogMaxFiles to 10.

That's what I see in the logs:

$ for i in `ls *.gz`; do echo file: $i; zcat $i|head -n 1; zcat $i|tail -n 1; done
...
file: 0.log.20241223-161939.gz
2024-12-23T16:19:24.969362937Z stdout F 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 
2024-12-23T16:19:39.66287371Z stdout P 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 012345678

file: 0.log.20241223-161950.gz
2024-12-23T16:19:39.696095101Z stdout F 9 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 
2024-12-23T16:19:50.943256914Z stdout F 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 

Environment:

  • AWS Region: eu-west-1
  • Instance Type(s): t3., m5a., m5n., m6a.
  • Cluster Kubernetes version: 1.29
  • Node Kubernetes version: v1.29.6-eks-1552ad0
  • AMI Version: amazon-eks-node-1.29-v20240807
@mikheevsv mikheevsv added the bug Something isn't working label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant