devabhishekpal commented on code in PR #5154:
URL: https://github.com/apache/ozone/pull/5154#discussion_r1285732986


##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx:
##########
@@ -339,7 +341,14 @@ export class Datanodes extends 
React.Component<Record<string, object>, IDatanode
       loading: true,
       selectedColumns: this._getSelectedColumns(prevState.selectedColumns)
     }));
-    axios.get('/api/v1/datanodes').then(response => {
+
+    if (typeof cancelToken != typeof undefined){
+      //Some existing request might be there so we will cancel that before 
sending new request
+      cancelToken.cancel("Cancelling old datanode request");

Review Comment:
   We cannot explicitly call componentWillUnmount. It is auto triggered before 
the component is just about to be removed from DOM. Take it as the equivalent 
of say stop() for a thread, only we cannot explicitly do 
this.componentWillUnmount() to call it. So I had it handled in _loadData().



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to