Stop requeuing a folder on its own engine-generated feedback (#181) - #191
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #181.
Problem
On startup (and in general operation) the active folder visibly jumps around: the queue should run one folder at a time in config order and not come back to a folder that already had its pass, but in practice some folders re-ran immediately several times in a row while others waited (evidence: 8 engine runs within 27s, immediate re-queues not interval-triggered).
Root cause (verified)
nextcloudcmdwrites its sync journal.sync_*.dbinside the synchronized folder, and that tree is watched by the FsWatcher. Every run therefore emits self-generatedLocalInotifyevents in two windows:requestqueued them andfinishedre-queued them as follow-up (feedback_followup_pending).requestqueued them viaschedule_debounce;cooldown_finishedsaw a non-empty queue and started another run immediately.Each run rewrites the journal, perpetuating the cycle (8 runs in 27s). The #165 suppression only covered feedback during a
Conflictoutcome; post-Successrequeue and cooldown events escaped.Fix
src/core/scheduler.rsonly:request(): dropLocalInotifywhilerunning || preparing || in_cooldown- only a genuine post-cooldown change re-queues.finished(): removed thefeedback_followup_pending/inotify_during_syncmachinery and thefeedback_followupparameter; uniformqueue.discard(LocalInotify)for finished runs. Related fields andstop()cleaned up.Testing
4 tests (3 new + 1 updated), red-green confirmed:
finished_folder_with_only_self_generated_feedback_is_not_requeuedlocal_feedback_during_cooldown_is_not_requeuedconflicted_folder_does_not_rerun_on_its_own_feedback(the 6x real case)Gate: 694 passed, clippy clean, fmt applied. Note: the #189 ETag gate already removed the interval re-scan without a change; this closes the separate engine-generated-local-feedback vector, so after its pass a folder only runs on a genuine change.