-
Notifications
You must be signed in to change notification settings - Fork 481
Add root node to resource viewer schema #1944
Comments
@wwitzel3 I am taking this one :) |
Environment ReplicationTo replicate this issue the context "gke_cnabu-wwitzel3_us-central1-c_octant-dev-cluster" has used with the namespace mink-system and the pod dataplane Test Race ConditionIt was expecting to see the race condition on objectvisitor.go since each typedVisitors use go routines to load the information and are only sync on the function level on not on the objectVisitior level Sidenote: These go routines does not seem to be necessary, removing them just increase the loading time by a 100 to 200 ms in the worst case tested where the total time was 15 segs using go routines and 15 segs and 200 ms without them But removing all the typedVisitors from https://github.com/vmware-tanzu/octant/blob/master/internal/objectvisitor/objectvisitor.go#L89 but NewPod it is still posible to see the change on the diagram Conclusion race condition test: the problem is not a race condition due to lack of sync on objectvisitot.go Empty array return by defaultAfter more testing it was posible to see the double rendering is because the first time the dynamic cache return and empty array for the services and others "resources" is still no clear why is this happening |
What steps did you take and what happened:
The resource viewer uses an adjacency list without a root node to generate the graph. As a result, it is possible to generate functionally identical lists that are rendered differently by graphvis. The video below shows a Service (uid:
61e5de4c-963c-4d8d-92e5-74dbad1dc881
) that changes positions because it switches between being an edge and a node for the pod.I suspect this is due to the traversal order from the typed visitors
PodsForService
andServicesForPod
where the goroutine that wins decides whether a given service is added as an edge or node:https://github.com/vmware-tanzu/octant/blob/ba9a2da77e7538a5bbe205452e0161dfe1ba98d8/internal/objectvisitor/pod.go#L68
https://github.com/vmware-tanzu/octant/blob/1c57c1ef580f93630e5358814be98872c1f72100/internal/objectvisitor/service.go#L62)
The resource viewer needs to ensure the object in the view is the first object recorded in the adjacency list.
Screencast.2021-02-02.18.18.27.mp4
Initial:
Changed:
The text was updated successfully, but these errors were encountered: