thelastpickle / cassandra-reaper

Automated Repair Awesomeness for Apache Cassandra
http://cassandra-reaper.io/
Apache License 2.0
487 stars 217 forks source link

Bug: webui will generate a huge number of requests if `_refreshClusterStatus` keep getting error responses #1442

Closed upsilon2gamma closed 9 months ago

upsilon2gamma commented 10 months ago

Project board link

https://github.com/thelastpickle/cassandra-reaper/blob/master/src/ui/app/jsx/cluster-list.jsx#L52-L71

According to JQuery doc (https://api.jquery.com/jQuery.ajax/), complete function will be called whether the ajax request succeeds or fails. As a result, _refreshClusterStatus will set two new scheduled calls if the ajax request gets an error response (the first one by error and the second one by complete).

If _refreshClusterStatus keeps getting error responses (e.g. token has expired, the ajax request always gets 304 response), it will generate a huge number of requests in 10min (doubles every 30s)