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
While reading the relevant code I realized that we make (somewhat unconscious) assumption that the state (removable files) only survives until the next Ensure or Install call, so the user can't really call both or one of those repeatedly, unless they also always call Remove before.
There is a number of problems related to thread-safety currently:
We track the state in a slice which isn't guarded by any synchronization mechanism, so if someone was to call Ensure and Remove at the same time this could result in a data race condition.
Additionally the state is shared between both Ensure and Install methods and the Remove method would just remove any removable files that are currently present in the slice.
While reading the relevant code I realized that we make (somewhat unconscious) assumption that the state (removable files) only survives until the next Ensure or Install call, so the user can't really call both or one of those repeatedly, unless they also always call Remove before.
There is a number of problems related to thread-safety currently:
hc-install/installer.go
Line 17 in e677aa4
We track the state in a slice which isn't guarded by any synchronization mechanism, so if someone was to call
Ensure
andRemove
at the same time this could result in a data race condition.Additionally the state is shared between both
Ensure
andInstall
methods and theRemove
method would just remove any removable files that are currently present in the slice.hc-install/installer.go
Lines 126 to 133 in e677aa4
The text was updated successfully, but these errors were encountered: