Fixes https://github.com/spring-projects/spring-integration/issues/3980 When not `isSharedSession`, the `initClient()` is called for every session we request from the factory and in concurrent calls we end up with not initialized SSH client in some threads. * Add `synchronized` double check logic to the `initClient()` to block other threads while the first one initialize the client * Use `volatile boolean` instead of `AtomicBoolean` and change its state when `SshClient` is created and started