You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've looked a bit more into this. When starting the backend it will start watching for plugin changes. When it detects change it will send a X-Reload header to the frontend.
But it also happens just when starting backend for the first time. You can notice the following log in the backend output
{"level":"info","source":"/home/dubenko/headlamp/backend/pkg/plugins/plugins.go","line":224,"time":"2024-08-01T12:23:23+02:00","message":"Sending reload plugins signal to frontend"}
I've traced it down to plugins.go file. It manually sends a fsevent for all files on the first run, I think this is the issue
funcperiodicallyWatchSubfolders(watcher*fsnotify.Watcher, pathstring, interval time.Duration) {
// ...// when a folder is added, send events for all the files in the folderentries, err:=os.ReadDir(path)
iferr!=nil {
logger.Log(logger.LevelError, map[string]string{"path": path},
err, "reading dir")
returnerr
}
for_, entry:=rangeentries {
watcher.Events<- fsnotify.Event{Name: filepath.Join(path, entry.Name()), Op: fsnotify.Create}
}
// ...
}
When starting the app, I see it load, and then reload about 2 seconds after. It's much quicker when not in developer mode, but it does still reload.
I tried this with current main, and also a previous release 0.24.1. I'm not sure how long it's been happening, and haven't bisected back further.
It's not such a problem because in release mode it's very quick and barely noticeable. In dev mode it's just slightly annoying (to me anyway).
The text was updated successfully, but these errors were encountered: