Skip to content

feat: log per-dir traversal at debug + a periodic progress heartbeat#30

Merged
rezk2ll merged 2 commits into
mainfrom
feat/log-traversal-progress
May 11, 2026
Merged

feat: log per-dir traversal at debug + a periodic progress heartbeat#30
rezk2ll merged 2 commits into
mainfrom
feat/log-traversal-progress

Conversation

@rezk2ll

@rezk2ll rezk2ll commented May 11, 2026

Copy link
Copy Markdown
Member

Summary

  • Every existing info-level walker event was per-file (migration.file_transferred / skipped / failed). A directory-only subtree (node_modules, .yarn, etc) can run for many minutes without any of those firing, which is indistinguishable from a wedged process. flushProgress only flushes every N files so the tracking doc looks frozen too.
  • Add a debug-level migration.dir_visited after each listing, carrying the current path, entries count, pending queue size and running total of directories visited.
  • Add an info-level migration.progress heartbeat that fires every 30 s independent of file activity. Cleared in finally so a settled migration does not leak the timer.

rezk2ll added 2 commits May 11, 2026 15:36
Until now every info-level walker event was per-file: transferred,
skipped, failed. A directory-only subtree (think node_modules,
.yarn, etc) can run for many minutes without any of those firing,
which from the outside looks identical to a wedged process — the
tracking doc is frozen too because flushProgress only flushes every
N files, never on bare dir visits.

Add a debug-level migration.dir_visited event after each listing,
carrying the current path, entries count, pending queue size and
running total of directories visited. Add an info-level
migration.progress heartbeat that fires every 30s independent of
file activity. Together they turn the silent traversal into an
observable one: operators get a steady "still alive" signal at
info, plus a precise breadcrumb trail at debug for diagnosis.
The 5-field object literal was constructed on every iteration of
the traversal loop regardless of LOG_LEVEL, since pino only checks
the level after receiving its arguments. With ~10k+ dir visits
per migration on a node_modules-class tree and multiple concurrent
migrations per process, that is a measurable allocation we can
avoid with a single isLevelEnabled call.
@rezk2ll rezk2ll merged commit ff78fdc into main May 11, 2026
3 checks passed
@github-actions github-actions Bot deleted the feat/log-traversal-progress branch May 11, 2026 13:40
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