Skip to content

fix: Avoid file truncation in munmap

We've been seeing issues with client metrics being truncated after the Puma master (worker 0) process is killed. It appears that this was happening:

  1. Puma parent process starts and opens histogram_puma_master-0.db and creates a bunch of metrics, causing the file size to increase to 16K.
  2. Puma parent forks this process as worker 0.
  3. Puma worker 0 continues to add more metrics and increases the size of the metrics, from 32K to 64K, and so on.
  4. Puma worker 0 is killed.
  5. A new Puma worker forks from parent and attempts to close. Although the actual length is 64K, this new worker inherits from parent and erroneously truncates the metrics file to 16K.

The simplest solution is to disable this truncation since it causes issues and doesn't really add value.

Closes #53 (closed)

Edited by Stan Hu

Merge request reports

Loading