From 2f05b985481ce1dbc2f6f7ce28c3dd1ed549fc9b Mon Sep 17 00:00:00 2001 From: labkey-tchad Date: Wed, 19 Aug 2026 14:41:37 -0700 Subject: [PATCH] Let subclasses route DockerSessionListener's container stop DockerSessionListener.valueUnbound() stopped containers via DockerService directly, so RStudioSessionListener (the only subclass) never told DockerRStudioManager to invalidate its cached process for that container. Added an overridable stopContainer() hook so subclasses with their own container cache can stay consistent. --- .../org/labkey/api/docker/DockerSessionListener.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/api/src/org/labkey/api/docker/DockerSessionListener.java b/api/src/org/labkey/api/docker/DockerSessionListener.java index 58a44855abe..9ef9db74141 100644 --- a/api/src/org/labkey/api/docker/DockerSessionListener.java +++ b/api/src/org/labkey/api/docker/DockerSessionListener.java @@ -48,7 +48,7 @@ public void valueUnbound(HttpSessionBindingEvent httpSessionBindingEvent) try { - DockerService.get().stop(_containerId); + stopContainer(_containerId); } catch (Exception ex) { @@ -57,4 +57,13 @@ public void valueUnbound(HttpSessionBindingEvent httpSessionBindingEvent) } protected void preStop() {} + + /** + * Override to route the stop through a service-specific manager (e.g. DockerRStudioManager) when one tracks + * its own cache of containers; the default here stops via DockerService directly, leaving such a cache stale. + */ + protected void stopContainer(@NotNull String containerId) + { + DockerService.get().stop(containerId); + } }