[
https://issues.apache.org/jira/browse/HADOOP-10839?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chris Nauroth updated HADOOP-10839:
-----------------------------------
Target Version/s: 3.0.0, 2.6.0
Release Note: The {{MetricsSystem}} abstract class has added a new
abstract method, {{unregisterSource}}, for unregistering a previously
registered metrics source. Custom subclasses of {{MetricsSystem}} must be
updated to provide an implementation of this method.
Hi, [~shanyu]. It looks like this patch needs to be rebased against current
trunk. Could you please take a look? Aside from that, I have just one more
minor comment. There is some unusual indentation here:
{code}
@Override public synchronized
void unregisterSource(String name) {
{code}
Would you please change that to:
{code}
@Override
public synchronized void unregisterSource(String name) {
{code}
I'll be +1 after that.
Note that this is a backwards-incompatible change. However, {{MetricsSystem}}
is annotated {{Evolving}}, so the policy allows us to make a breaking change on
a minor version boundary, targeting 2.6.0. I think it fills an important gap
in the metrics API too. I've entered a release note about this.
I'll wait until end of day Wednesday before committing in case anyone else
wants to comment.
> Add unregisterSource() to MetricsSystem API
> -------------------------------------------
>
> Key: HADOOP-10839
> URL: https://issues.apache.org/jira/browse/HADOOP-10839
> Project: Hadoop Common
> Issue Type: Bug
> Components: metrics
> Affects Versions: 2.4.1
> Reporter: shanyu zhao
> Assignee: shanyu zhao
> Attachments: HADOOP-10839.patch
>
>
> Currently the MetrisSystem API has register() method to register a
> MetricsSource but doesn't have unregister() method. This means once a
> MetricsSource is registered with the MetricsSystem, it will be there forever
> until the MetricsSystem is shut down. This in some cases can cause Java
> OutOfMemoryError.
> One such case is in file system metrics implementation. The new
> AbstractFileSystem/FileContext framework does not implement a cache so every
> file system access can lead to the creation of a NativeFileSystem instance.
> (refer to HADOOP-6356). And all these NativeFileSystem needs to share the
> same instance of MetricsSystemImpl, which means we cannot shut down
> MetricsSystem to clean up all the MetricsSources that has been registered but
> no longer active. Over time the MetricsSource instance accumulates and
> eventually we saw OutOfMemoryError.
--
This message was sent by Atlassian JIRA
(v6.2#6252)