mirror of
https://github.com/open-webui/oikb.git
synced 2026-11-05 01:27:25 +00:00
[GH-ISSUE #143] oikb watch re-syncs in a loop: the watcher treats its own file reads (watchdog opened/closed_no_write) as changes #80
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/oikb#80
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MiskyCAN on GitHub (Oct 11, 2026).
Original GitHub issue: https://github.com/open-webui/oikb/issues/143
Versions: oikb 0.5.0 (also 0.4.0), watchdog 6.0.0, Python 3.14, Linux (inotify)
What happens: once a file in a watched folder is read while
oikb watchis running, the watcher syncs about once a second, indefinitely. Every sync reports "N unchanged", and each one sends aPOST /api/v1/knowledge/{id}/sync/diff. One of our watchers ran like this continuously (~80,000 diff requests a day). Earlier, on the day that folder was set up, the same loop logged "Diff: +3" every second and left ~1,200 duplicate uploads behind.Cause:
_DebouncedHandler.on_any_eventinoikb/watcher.pyre-arms the debounce timer for every event type. watchdog 6 reports read-only access on Linux asopenedandclosed_no_write. A sync reads every file to hash it, so the sync emits exactly the events that schedule the next sync.Repro (no server needed; uses the handler directly):
Fix that works for us: ignore the read-only event types in
on_any_event. A real change still arrives as created/modified/deleted/moved (andclosedafter a write).With that change the repro prints 1.