Bug 1775755 - Dashboard freezes if a non existing model is requested by some card
Summary: Dashboard freezes if a non existing model is requested by some card
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.3.0
Assignee: Rastislav Wagner
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On: 1769317
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-22 17:32 UTC by Samuel Padgett
Modified: 2019-12-03 08:08 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1769317
Environment:
Last Closed: 2019-12-02 20:31:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 3545 0 'None' 'open' 'Bug 1775755: Mark all resources as optional to always render card by firehose' 2019-12-02 20:28:25 UTC

Description Samuel Padgett 2019-11-22 17:32:26 UTC
+++ This bug was initially created as a clone of Bug #1769317 +++

We are using Firehose to watch resources See https://github.com/openshift/console/blob/master/frontend/public/components/dashboard/with-dashboard-resources.tsx#L161 . Every card is wrapped in withDashboardResources HOC which injects functions to watch URL, Prometheus and k8s resource. A card will use useEffect hook to call watchK8sResource(requested_resource) which will update withDashboardResources's state and updates Firehose's resources prop.

 

The problem is that if the component is watching only resource(s) which do not exist in the cluster (like ClusterVersion CRD on non-OpenShift) the Firehose will render null https://github.com/openshift/console/blob/master/frontend/public/components/utils/firehose.jsx#L245 which in turn will call Card's useEffect cleanup function which calls stopWatchK8sResources(requested_resource) - this will update withDashboardResources's state and Firehose's resources prop is set to empty array - Firehose will now render the Card (as every resource is loaded) and now the loop starts - Card is rendered and useEffect is called again - we are at the beginning.

Comment 1 Samuel Padgett 2019-12-02 20:31:56 UTC
I think we can fix in 4.4 and skip the backport since I'm not aware of any user-facing bug. We should not be requesting any resource that doesn't exist in an OpenShift 4.3 cluster. Rastislav, let me know if that's incorrect.

Comment 2 Rastislav Wagner 2019-12-03 08:08:56 UTC
That is correct, we dont have such a case in 4.3


Note You need to log in before you can comment on or make changes to this bug.