final Connection connection = connectionManager.getConnection();
StreamUtils.safeClose(connection);
if(connection != null) {
try {
// Wait for the connection to be closed
connection.awaitClosed();
} catch (InterruptedException e) {
throw new InterruptedIOException();
}
}
}