Panel render loop

Hi!

I’m farely new at developing grafana plugins. My panels work alright except for one thing: there seems to be some sort of loop evolving the state of the application and, thus, requesting a new render. But the new state seams identical to the current one.
Moreover this loop is not consistent in the use case: same operations do not always cause the loop to start.
It appears to affect all my panels, both the ones extending the React.FC and the ones which are not, both the ones the use the useState and useMemo APIs and the ones which don’t.
Have anybody encountered this sort of behaviour? I couldn’t find anything helping in identifying the root cause of it.

Thanks

Difficult to say without more details. If the React component updates, it means some dependent state changed. Could you explain more about this ‘loop’? I assume you’re not referring to the dashboard refresh interval which runs the queries every few seconds?

Hi Marcus,

as You correctly assumed, I’m not talking about the render due to the refresh interval. What I’m talking about is what appears to be a looped render call that is invoked in absence of a (evident) change of state. The problem is kinda of a pain to replicate, I haven’t really found a predictable series of step to consistently replicate the problem: sometimes it happens when I edit a panel, sometimes it happens on the dashboard.
I tried to change the panels to stateful components so to compare the new state to the old state and they appear to be identical.
As I said, it is kind of a perplexing issue, made worst by the inability to consistently replicate it…

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.