[
https://issues.apache.org/jira/browse/HDFS-16518?focusedWorklogId=747447&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-747447
]
ASF GitHub Bot logged work on HDFS-16518:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 24/Mar/22 20:43
Start Date: 24/Mar/22 20:43
Worklog Time Spent: 10m
Work Description: omalley commented on pull request #4100:
URL: https://github.com/apache/hadoop/pull/4100#issuecomment-1078244353
I commented on the jira, but:
I don't understand why this is required. Obviously at jvm shutdown the cache
will be discarded. The order of shutdown hooks isn't deterministic, so using
this isn't a fix against other shutdown hooks using the cache.
Is there some other call to KeyProvider.close() that this should replace?
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 747447)
Time Spent: 1.5h (was: 1h 20m)
> Cached KeyProvider in KeyProviderCache should be closed with
> ShutdownHookManager
> --------------------------------------------------------------------------------
>
> Key: HDFS-16518
> URL: https://issues.apache.org/jira/browse/HDFS-16518
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: hdfs
> Affects Versions: 2.10.0
> Reporter: Lei Yang
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> We need to make sure the underlying KeyProvider used by multiple DFSClient
> instances is closed at one shot during jvm shutdown. Within the shutdownhook,
> we invalidate the cache and make sure they are all closed. The cache has a
> removeListener hook which is called when cache entry is invalidated.
> {code:java}
> Class KeyProviderCache
> ...
> public KeyProviderCache(long expiryMs) {
> cache = CacheBuilder.newBuilder()
> .expireAfterAccess(expiryMs, TimeUnit.MILLISECONDS)
> .removalListener(new RemovalListener<URI, KeyProvider>() {
> @Override
> public void onRemoval(
> @Nonnull RemovalNotification<URI, KeyProvider> notification) {
> try {
> assert notification.getValue() != null;
> notification.getValue().close();
> } catch (Throwable e) {
> LOG.error(
> "Error closing KeyProvider with uri ["
> + notification.getKey() + "]", e);
> }
> }
> })
> .build();
> }{code}
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]