Do you have a minimal code snippet I can use to try this? I've tried the 
following code, but after closing the context the app is still running, because 
there are still some open resources left:

```java
try {
   Template template = compute.templateBuilder()
      .osFamily(OsFamily.CENTOS)
      .smallest()
      .build();
   NodeMetadata node = 
Iterables.getOnlyElement(compute.createNodesInGroup("ssh", 1, template));

   SshClient ssh = context.utils().sshForNode().apply(node);
   ssh.connect();

   BufferedReader in = null;
   try {
      ExecChannel channel = ssh.execChannel("yum -y update");
      in = new BufferedReader(new InputStreamReader(channel.getOutput()));
      String line = null;
      while ((line = in.readLine()) != null) {
         System.out.println("SSH> " + line);
      }
    } finally {
      if (in != null) {
         in.close();
      }
      ssh.disconnect();
   }
} finally {
   context.close();
}
```

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/778#issuecomment-114058372

Reply via email to