title: CompletableFuture does not complete on timeout
body: <p>I have a method <code>read</code> that reads from input stream. I want to complete the future if <code>read</code> has not finished after timeout.</p>
  
  <pre><code>public static void main(String[] args) {
     CompletableFuture&lt;?&gt; future = new CompletableFuture&lt;&gt;();
     future
        .thenRunAsync(() -&gt; {
           try {
              read(data);
           } catch (IOException e) {
              future.completeExceptionally(e);
           }
        })
        .orTimeout(1, TimeUnit.SECONDS);
  
     future.join();
  } 
  </code></pre>
  
  <p>But when I run this code, it does not finish by timeout and waits for input stream anyway. </p>