Files
rclone/cmd/bisync
nielash 387b4b5e11 bisync: fix memory leak when running via the rc
Before this change, `fastCopy` created a cancellable context for the sync and
stored its cancel func on the `bisyncRun`, but only ever called it when
gracefully shutting down. On a normal run, it was never called, and until it is
cancelled, a context from `context.WithCancel` stays registered with its nearest
cancellable ancestor.

For an rc job, that ancestor is the job's own context, which the job registry
retains for `--rc-job-expire-duration`. The sync context carries bisync's
`LoggerOpt`, whose `LoggerFn` is a method value on `*bisyncRun`, so a finished
run was kept alive -- including the Path1 and Path2 listings -- for as long as the
job was.

This change fixes the issue by cancelling the sync context when `fastCopy`
returns. The cancel func is still stored on the `bisyncRun`, so a graceful
shutdown can still interrupt a sync that is in progress.
2026-08-08 20:39:49 -04:00
..
2025-11-03 16:52:33 +00:00
2026-03-03 16:13:00 -05:00
2025-08-17 20:16:46 -04:00
2026-03-03 16:13:00 -05:00
2021-11-01 21:00:27 +03:00
2025-08-17 20:16:46 -04:00
2025-08-17 20:16:46 -04:00
2026-05-01 15:56:56 +01:00
2025-08-17 20:16:46 -04:00