clickhouse-java
clickhouse-java copied to clipboard
[Client] Worker thread doesn't catch all exceptions and fails silently
Describe the bug
Precondition: async option is enabled.
When request is executed there is a worker thread that calls actual client and sends out data while calling thread returns with future to an application code (see com.clickhouse.client.AbstractClient#execute
).
Here is worker function:
return CompletableFuture.supplyAsync(() -> {
try {
return sendAsync(sealedRequest, args);
} catch (ClickHouseException | IOException e) {
throw new CompletionException(ClickHouseException.of(e, sealedRequest.getServer()));
}
}, getExecutor());
If any RuntimeException
that is not derived from ClickHouseException
or IOException
(for example IllegalArgumentException
) than it will not cause Future to fail.