cryostatio / cryostat-web

Web front-end for Cryostat: Secure JDK Flight Recorder management for containerized JVMs
https://cryostat.io/
Other
10 stars 20 forks source link

[Bug] Topology view does not update on target notifications #1253

Closed andrewazores closed 1 month ago

andrewazores commented 3 months ago
          Looks like it worked - the deletion button appears again, and after clicking it I can see a request sent and success response from the server, and a "target lost" notification. However, the Topology view didn't update on the notification, so I had to navigate away and back to see the updated view state.

Seems like a separate bug, but worth noting. In testing https://github.com/cryostatio/cryostat3/pull/407 it looks like Agents deregistering also doesn't trigger Topology to update, so it could be a common root cause.

Originally posted by @andrewazores in https://github.com/cryostatio/cryostat-web/issues/1252#issuecomment-2076026769

tthvo commented 3 months ago

Oh that's also odd. On my end, after seeing the loss notification (i.e. for custom target), the target disappeared. That also worked for kubeAPIDiscovery where I deleted a deployment or scale down replicas.

Screencast from 2024-04-24 20-10-47.webm

andrewazores commented 3 months ago

Worked this time around - I think I may have been running an image based on https://github.com/cryostatio/cryostat3/pull/407 when it happened, so this is really a bug in that PR, not one in main.

andrewazores commented 3 months ago

Here is my simple reproducer:

Run:

$ ./smoketest.bash -O

Then open the web UI and go to the Topology view. Create a custom target localhost:9091, then delete it. It should work as expected.

Then stop the smoketest and restart it, this time:

$ ./smoketest.bash -Ot # add the -t to run sample applications

and repeat the UI test. Now it sometimes (not sure the frequency or what else goes into it) fails to update the Topology view, though the notification popup does still appear, and navigating away and back shows the correct updated state. Also from other testing and examination of the database contents during this flow, the server and database really are updating their state correctly.

Anyway, I think this is a pretty minor bug since it only happens occasionally and is easily worked around by just clicking away and back.

andrewazores commented 3 months ago

Similarly I also see occasional instances where the Topology view does not update when a target discovery notification is received. Just now I had that happen when looking at the Topology view in an OpenShift deployment and a new KubernetesApi discovery occurred. The notification appeared but the view did not update until I navigated away and back.

tthvo commented 3 months ago

Anyway, I think this is a pretty minor bug since it only happens occasionally and is easily worked around by just clicking away and back.

Ahh that's unfortunate. I can't see where the issue can be. Though, that being said, how about a refresh button somewhere in the toolbar to refresh the tree instead of navigating away? Not fixing the issue but could help a bit with UX.

andrewazores commented 3 months ago

I'd rather avoid that as much as possible. The UI used to be built that way years ago, with a refresh button and an optional auto-refresh timer, and it's much nicer to have properly working notifications and state updates...

tthvo commented 3 months ago

Right that makes sense...Now that I though of it, can't see where that refresh button fit in the UI either haha

andrewazores commented 1 month ago

This looks like it has been solved.