Skip to content

Commit 501a1de

Browse files
committed
Fix #35406: don't destroy sessions on shutdown
1 parent 738a500 commit 501a1de

1 file changed

Lines changed: 19 additions & 6 deletions

File tree

src/main/java/eu/openanalytics/containerproxy/service/session/undertow/CustomSessionManagerFactory.java

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,7 @@ public class CustomSessionManagerFactory implements SessionManagerFactory {
3636
@Override
3737
public SessionManager createSessionManager(Deployment deployment) {
3838
if (inMemorySessionManager == null) {
39-
inMemorySessionManager = new InMemorySessionManager(
40-
deployment.getDeploymentInfo().getSessionIdGenerator(),
41-
deployment.getDeploymentInfo().getDeploymentName(),
42-
-1,
43-
false,
44-
deployment.getDeploymentInfo().getMetricsCollector() != null);
39+
inMemorySessionManager = new CustomInMemorySessionManager(deployment);
4540
}
4641
return inMemorySessionManager;
4742
}
@@ -50,4 +45,22 @@ public InMemorySessionManager getInstance() {
5045
return inMemorySessionManager;
5146
}
5247

48+
private static class CustomInMemorySessionManager extends InMemorySessionManager {
49+
50+
public CustomInMemorySessionManager(Deployment deployment) {
51+
super(deployment.getDeploymentInfo().getSessionIdGenerator(),
52+
deployment.getDeploymentInfo().getDeploymentName(),
53+
-1,
54+
false,
55+
deployment.getDeploymentInfo().getMetricsCollector() != null);
56+
}
57+
58+
@Override
59+
public void stop() {
60+
// do not destroy sessions on shutdown (they are stored only in memory)
61+
// see #35406
62+
}
63+
64+
}
65+
5366
}

0 commit comments

Comments
 (0)