Skip to content

Fix log overflow#162

Open
mschwoer wants to merge 3 commits into
mainfrom
fix-log-overflow
Open

Fix log overflow#162
mschwoer wants to merge 3 commits into
mainfrom
fix-log-overflow

Conversation

@mschwoer

Copy link
Copy Markdown
Contributor

Limit log file growth

@claude

claude Bot commented Jun 10, 2026

Copy link
Copy Markdown

Code Review: Fix log overflow

The approach is sound and follows container best practices. Good overall.


Bug / Gap: misc/nginx_no_ssl.conf not updated

misc/nginx.conf was correctly updated to redirect logs to /dev/stderr and /dev/stdout, but misc/nginx_no_ssl.conf still has the old file paths:

error_log /var/log/nginx/error.log warn;
access_log /var/log/nginx/access.log main;

Deployments using the no-SSL config will continue writing to files that no longer exist as a mounted volume. nginx will either fail to start or silently produce no logs. Needs the same update as nginx.conf.

Minor: format_message defensive branch is untested and has a type inconsistency

In local_disk_space_alert.py line 43:
free_space_gb = issues[0][1] if issues else 'unknown'

The 'unknown' fallback is never exercised by the test suite and gives the variable an inconsistent int|str type. Since format_message is only called when issues is non-empty (see BaseAlert), this branch is dead code. Either remove it and let it fail loudly (preferred), or add a dedicated test.

Nit: LOCAL_DISK_PATH = '/etc/hosts' deserves a clearer comment

The real assumption is that /etc/hosts lives on the same partition as Docker's overlay filesystem, which is almost always true in Docker but not guaranteed (e.g. in Kubernetes /etc/hosts is a tmpfs bind-mount). Using '/' directly would be more robust and self-documenting.


Observations

  • Log budget: ~10 Airflow workers + other services = ~5-6 GB at peak rotation. LocalDiskSpaceAlert now watches exactly this. Nice symmetry.
  • LocalDiskSpaceAlert is well structured: follows DiskSpaceAlert pattern, del status_objects idiom is consistent, tests cover threshold boundary and OSError path.
  • Webapp cleanup is the right call; containerised apps should log to stdout.
  • docker-compose.yaml coverage is complete: airflow services inherit logging from x-airflow-common, standalone services each have explicit entries. No gaps.

Summary:

  • BLOCKING: misc/nginx_no_ssl.conf not updated -- nginx fails on no-SSL deployments
  • Non-blocking: Dead 'unknown' branch in format_message; inconsistent int|str type
  • Nit: LOCAL_DISK_PATH comment could clarify the partition assumption

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.

1 participant