-
Notifications
You must be signed in to change notification settings - Fork 454
Open
Labels
backendIssues related to the backendIssues related to the backendkind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.pluginspriority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Milestone
Description
There's a race condition for when files are copied into place when doing an npm start from within a plugin, and the backend being able to see if a file exists inside GeneratePluginPaths.
This is the error in the backend:
{
"level":"info",
"pluginPath":"/home/user/.config/Headlamp/plugins/change-logo/main.js",
"source":"/home/runner/work/headlamp/headlamp/backend/pkg/plugins/plugins.go","line":131,
"error":"stat /home/user/.config/Headlamp/plugins/change-logo/main.js: no such file or directory",
"time":"2024-03-06T17:42:59+05:30",
"message":"Not including plugin path, main.js not found"
}But when doing an ls on the file it is there.
When npm start inside the plugin is stopped, the issue disapears.
So there seems to be a race condition.
To reproduce
# Have backend running in one terminal.
make run-backend
# In the other terminal
cd examples/plugins/change-logo/
npm i
npm start
Notes
plugins.go@HandlePluginEventsis the code which watches for events and runs the path generationheadlamp-plugin.js@copyToPluginsFolderis what copies the plugin files using some webpack code "FileManagerPlugin". Not sure if it does atomic moves, or if removes and deletes inside.
Metadata
Metadata
Assignees
Labels
backendIssues related to the backendIssues related to the backendkind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.pluginspriority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Type
Projects
Status
Queued