New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDDS-3248. shutdown defaultMetricsSystem before tests #704
Conversation
Thank you for figuring this out, and posting a JIRA about it. As in #705 I disagree with how the solution is implemented. (also the PR template is missing here as well, would be good to include it) |
Hi, you're right. we should clean up after tests, not before them. and I change this PR to use this approach. (I also edit the PR description to follow PR template) |
I don't understand why it-freon failed, I ran this command in my environment and it finished successfully
|
@@ -132,6 +132,7 @@ public void testContainerCloseActionWhenFull() throws IOException { | |||
|
|||
} finally { | |||
volumeSet.shutdown(); | |||
ContainerMetrics.remove(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we call shutdownDispatcher() here as well instead of just ContainerMetrics.remove()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed that method and unify all the calls to ContainerMetrics.remove()
if(dispatcher != null) { | ||
dispatcher.shutdown(); | ||
} | ||
ContainerMetrics.remove(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not convinced whether this step to remove the ContainerMetrics belongs to a method called shutdownDispatcher, at least from the name it is not clear it will do so besides shutting down the dispatcher. Shouldn't we separate this two?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually dispatcher.shutdown() method do nothing, and I put it here to follow the principle of shutdown used objects.
I will edit this part to just call ContainerMetrics.remove()
...r-service/src/test/java/org/apache/hadoop/ozone/container/common/interfaces/TestHandler.java
Outdated
Show resolved
Hide resolved
@@ -91,6 +92,7 @@ | |||
|
|||
@Before | |||
public void setup() throws IOException { | |||
DefaultMetricsSystem.instance().shutdown(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this one after the added cleanup in TestHddsDispatcher?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake, I will remove this
Thank you for the follow up, and addressing my concern, I have added a few inline comments, can you please check to the questions there? |
The changeset this way looks good to me, thank you for addressing the concerns, if it runs fine I am +1 on it (non-binding) |
Thank you for guiding me through this. :) |
What changes were proposed in this pull request?
clean up DefaultMetricSystem after TestHandler and TestHddsDispatcher
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-3248