Skip to content

Commit 9f37c9a

Browse files
committed
Improve onVirtualClusterStopped callback logging
Log at WARN with a message that reflects the serve:none policy intent. Add TODO noting the callback should eventually drive proxy shutdown rather than relying on the caller. Assisted-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
1 parent b6b6e47 commit 9f37c9a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

kroxylicious-runtime/src/main/java/io/kroxylicious/proxy/KafkaProxy.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ public KafkaProxy(PluginFactoryRegistry pfr, Configuration config, Features feat
163163
this.virtualClusterModels = config.virtualClusterModel();
164164
this.managementConfiguration = config.management();
165165
this.micrometerConfig = config.getMicrometer();
166-
this.vcm = new VirtualClusterManager(virtualClusterModels, (clusterName, cause) -> STARTUP_SHUTDOWN_LOGGER.atInfo()
166+
this.vcm = new VirtualClusterManager(virtualClusterModels, (clusterName, cause) -> STARTUP_SHUTDOWN_LOGGER.atWarn()
167167
.addKeyValue("virtualCluster", clusterName)
168168
.addKeyValue("cause", cause.orElse(null))
169-
.log("Virtual cluster stopped"));
169+
.log("Virtual cluster reached terminal stopped state, proxy shutdown required"));
170170
}
171171

172172
@VisibleForTesting
@@ -270,6 +270,8 @@ public KafkaProxy startup() {
270270
STARTUP_SHUTDOWN_LOGGER.atError()
271271
.setCause(e)
272272
.log("Exception during startup, shutting down");
273+
// TODO: the onVirtualClusterStopped callback should drive the serve:none policy (triggering proxy shutdown)
274+
// rather than relying on the caller to call shutdown() separately. Currently the callback only logs.
273275
virtualClusterModels.forEach(model -> vcm.initializationFailed(model.getClusterName(), e));
274276
shutdown();
275277
throw new LifecycleException("Startup completed exceptionally", e);

0 commit comments

Comments
 (0)