From b272c50c4cf8bd2bcf74c80128cfa5b6361fa701 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 22 Oct 2025 12:28:06 +0100 Subject: [PATCH] march: fix --no-traverse being very slow - fixes #8860 Before this change --no-traverse was calling NewObject on directories (where it would always fail) as well as files. This was very noticeable when doing syncs with --max-age which were only transferring a small number of objects. This should have been very quick, but the NewObject calls for each directory slowed the sync down a lot. This changes replaces the check to see if the source entry is an Object that got missed out from this commit: 88e30eecbf49a41c march: fix deadlock when using --no-traverse - fixes #8656 --- fs/march/march.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/march/march.go b/fs/march/march.go index 841ca4cc7..8b19baa6e 100644 --- a/fs/march/march.go +++ b/fs/march/march.go @@ -455,6 +455,11 @@ func (m *March) processJob(job listDirJob) ([]listDirJob, error) { go func() { defer workerWg.Done() for t := range matchTasks { + // Can't match directories with NewObject + if _, ok := t.src.(fs.Object); !ok { + t.dstMatch <- nil + continue + } leaf := path.Base(t.src.Remote()) dst, err := m.Fdst.NewObject(m.Ctx, path.Join(job.dstRemote, leaf)) if err != nil {