Skip to content

Commit

Permalink
HADOOP-11837. AuthenticationFilter should destroy SignerSecretProvide…
Browse files Browse the repository at this point in the history
…r in Tomcat deployments. Contributed by Bowen Zhang.
  • Loading branch information
Haohui Mai committed Apr 17, 2015
1 parent 76e7264 commit c6b5203
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Expand Up @@ -187,6 +187,7 @@ public class AuthenticationFilter implements Filter {
private long validity;
private String cookieDomain;
private String cookiePath;
private boolean isInitializedByTomcat;

/**
* <p>Initializes the authentication filter and signer secret provider.</p>
Expand Down Expand Up @@ -252,6 +253,7 @@ protected void initializeSecretProvider(FilterConfig filterConfig)
secretProvider = constructSecretProvider(
filterConfig.getServletContext(),
config, false);
isInitializedByTomcat = true;
} catch (Exception ex) {
throw new ServletException(ex);
}
Expand Down Expand Up @@ -380,6 +382,10 @@ public void destroy() {
authHandler.destroy();
authHandler = null;
}
if (secretProvider != null && isInitializedByTomcat) {
secretProvider.destroy();
secretProvider = null;
}
}

/**
Expand Down
3 changes: 3 additions & 0 deletions hadoop-common-project/hadoop-common/CHANGES.txt
Expand Up @@ -1248,6 +1248,9 @@ Release 2.7.0 - UNRELEASED
HADOOP-11815. HttpServer2 should destroy SignerSecretProvider when it
stops. (Rohith via wheat9)

HADOOP-11837. AuthenticationFilter should destroy SignerSecretProvider in
Tomcat deployments. (Bowen Zhang via wheat9)

Release 2.6.1 - UNRELEASED

INCOMPATIBLE CHANGES
Expand Down

0 comments on commit c6b5203

Please sign in to comment.