CompletableFuture timeout vs cancel: which exception wins?
CompletableFuture timeout vs cancel: which exception wins? When a CompletableFuture is configured with completeOnTimeout and is later cancelled via cancel(true) , the future completes exceptionally with a CancellationException . The timeout mechanism does not override this exception even if the timeout period elapses after the cancellation. This behaviour ma