void (@NotNull ProcessEvent event) { final UUID processId = ((ExternalJavacProcessHandler)event.getProcessHandler()).getProcessId(); debug(()-> "process " + processId + " terminated"); myRunningProcesses.remove(processId); if (myConnections.get(processId) == null) { // only if connection has never been established // otherwise we rely on the fact that ExternalJavacProcess always closes connection before shutdown and clean sessions on ChannelUnregister event cleanSessions(processId); } }