HADOOP-11815. HttpServer2 should destroy SignerSecretProvider when it stops. Contributed by Rohith.
This commit is contained in:
parent
9a111fcd1d
commit
d665d11f99
|
@ -730,6 +730,9 @@ Release 2.7.0 - UNRELEASED
|
||||||
HADOOP-11796. Skip TestShellBasedIdMapping.testStaticMapUpdate on Windows.
|
HADOOP-11796. Skip TestShellBasedIdMapping.testStaticMapUpdate on Windows.
|
||||||
(Xiaoyu Yao via cnauroth)
|
(Xiaoyu Yao via cnauroth)
|
||||||
|
|
||||||
|
HADOOP-11815. HttpServer2 should destroy SignerSecretProvider when it
|
||||||
|
stops. (Rohith via wheat9)
|
||||||
|
|
||||||
Release 2.6.1 - UNRELEASED
|
Release 2.6.1 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -140,6 +140,7 @@ public final class HttpServer2 implements FilterContainer {
|
||||||
protected final List<String> filterNames = new ArrayList<>();
|
protected final List<String> filterNames = new ArrayList<>();
|
||||||
static final String STATE_DESCRIPTION_ALIVE = " - alive";
|
static final String STATE_DESCRIPTION_ALIVE = " - alive";
|
||||||
static final String STATE_DESCRIPTION_NOT_LIVE = " - not live";
|
static final String STATE_DESCRIPTION_NOT_LIVE = " - not live";
|
||||||
|
private final SignerSecretProvider secretProvider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to construct instances of HTTP server with specific options.
|
* Class to construct instances of HTTP server with specific options.
|
||||||
|
@ -335,7 +336,7 @@ public final class HttpServer2 implements FilterContainer {
|
||||||
this.adminsAcl = b.adminsAcl;
|
this.adminsAcl = b.adminsAcl;
|
||||||
this.webAppContext = createWebAppContext(b.name, b.conf, adminsAcl, appDir);
|
this.webAppContext = createWebAppContext(b.name, b.conf, adminsAcl, appDir);
|
||||||
try {
|
try {
|
||||||
SignerSecretProvider secretProvider =
|
this.secretProvider =
|
||||||
constructSecretProvider(b, webAppContext.getServletContext());
|
constructSecretProvider(b, webAppContext.getServletContext());
|
||||||
this.webAppContext.getServletContext().setAttribute
|
this.webAppContext.getServletContext().setAttribute
|
||||||
(AuthenticationFilter.SIGNER_SECRET_PROVIDER_ATTRIBUTE,
|
(AuthenticationFilter.SIGNER_SECRET_PROVIDER_ATTRIBUTE,
|
||||||
|
@ -945,6 +946,8 @@ public final class HttpServer2 implements FilterContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// explicitly destroy the secrete provider
|
||||||
|
secretProvider.destroy();
|
||||||
// clear & stop webAppContext attributes to avoid memory leaks.
|
// clear & stop webAppContext attributes to avoid memory leaks.
|
||||||
webAppContext.clearAttributes();
|
webAppContext.clearAttributes();
|
||||||
webAppContext.stop();
|
webAppContext.stop();
|
||||||
|
|
Loading…
Reference in New Issue