xichen01 opened a new pull request, #5845:
URL: https://github.com/apache/ozone/pull/5845

   ## What changes were proposed in this pull request?
   Solving StateContext memory leaks.
   ### Root cause
   The `cmdStatusMap` in the `StateContext` will only be cleaned up if the 
command is not in Pending status.
   
https://github.com/apache/ozone/blob/077e09b89e4d325243f0d29117a082d9da9a342f/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/report/CommandStatusReportPublisher.java#L76-L85
   
   When the `queue` of `DeleteBlocksCommand` is full, the command in 
`commandQueue` cannot be added to the `queue` of `DeleteBlocksCommand` and will 
be discarded from `commandQueue`, so the commands are never updated, resulting 
in a memory leak.
   
   ### Solution
   Here we set the commands that can't be added to `DeleteBlocksCommand` queue 
to `FAILED` state, so that they can be cleaned up.
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-9976
   
   ## How was this patch tested?
   unit test
   


-- 
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