github titandrive/yarnl v0.7.1
v0.7.1: Critical fix for CPU/RAM Leak

latest releases: v0.11.4, v0.11.3, v0.11.2...
7 months ago

Fix: node-cron CPU/RAM Leak

Problem

Yarnl uses cron scheduling for automated backups (daily/weekly/monthly) and archive auto-deletion. The previous dependency, node-cron, has a known bug that seems to be triggered by the recent time zone change, where if the Node.js event loop gets blocked (e.g. during a backup job), it detects missed executions and logs a warning for every single one in a tight infinite loop. This loop never terminates, causing CPU and RAM usage to climb continuously until the container becomes unusable and must be restarted.

Solution

Replaced node-cron with croner, a modern cron scheduler that does not exhibit this behavior. croner uses standard cron expressions and is a drop-in replacement.

This is the same fix applied to the ZeroByte project: nicotsx/zerobyte#631 (comment)

Changes

  • package.json: Removed node-cron, added croner ^9.0.0
  • server.js: Updated all cron job creation from cron.schedule(expr, fn) to new Cron(expr, fn)
    • Every-minute backup scheduler
    • Daily midnight archive auto-delete

References

Full Changelog: v0.7.0...v0.7.1

Don't miss a new yarnl release

NewReleases is sending notifications on new releases.