Loading
stop exposing nodes outside of dag.go to fix potential race conditions.
This is a follow-up of this discussion required to fix races detected while running go test -race ./... proposed in !576 (closed)
This MR is globally cleaning the dag interface by clearly separating Node and FluxObject roles:
Nodesare only dag vertexes, used to store references toFluxObjectsFluxObjectsstore all the attributes about topology and readyness alongside the flux object itself
Change all the ObjectMap interface to only expose FluxObject and ObjectList that are made thread-safe using a RWlock in this MR.
It'll be easier to review this MR one commit at a time:
- The first commit moves
watchedandreconciledattributes toFluxObjectan add a mutex lock this object's methods. This way client modules likewatch.gowon't need to access node objects any more. - The second commit removes the exposition of
Nodesoutisde ofdag.go, it exposesFluxObjectsthat are thread-safe instead. Node interface is made internal by renaming it todagNode - The last commit is only remaining references to
Nodeinwatch.goin variables and comments.
Relates-to
Edited by Thomas Morin