MemeLabs / MemeLabs/Rustla2

rustla2-api: glog writes unbounded log files to /tmp (no retention)

Open
#358 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
46
Forks
24
PR merge metrics
No merged PRs in 30d

Description

`rustla2-api` logs via glog's default file sink, which writes into `/tmp`
inside the container. glog opens a **new file per process start** and never
removes old ones, so a long-running deployment accumulates log files
indefinitely.

Observed on a long-lived container: ~50 files totalling ~6.7 GB, the oldest
dating to early 2024. Individual files reached 1.8 GB.

This is invisible in normal operation because a redeploy creates a fresh
container with an empty writable layer, discarding everything — then it
accumulates again from zero.

### Note on `--max_log_size`

Setting `--max_log_size` is **not** sufficient. That flag only rolls over to a
new file once the current one hits the cap; it does not delete previous files.
It would increase the file count without bounding total disk use.

### Suggested fix

Run with `--logtostderr` (or env `GLOG_logtostderr=1`) so logs go to stderr and
are captured by the container runtime, where they can be bounded by the log
driver's `max-size` / `max-file` options. This also makes `docker logs` useful
for this service, which it currently isn't.

If file logging is preferred instead, `--log_dir` should point at a mounted
volume with a logrotate policy attached.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the rustla2-api container launch configuration and its current glog setup. Verify how logs are written today, then make the service use stderr or a mounted volume with rotation; done means old files no longer accumulate unboundedly and container log collection is useful.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, docker
Domain
devops, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.