chrisdutz commented on code in PR #818: URL: https://github.com/apache/plc4x/pull/818#discussion_r1115303543
########## plc4j/tools/connection-cache/src/main/java/org/apache/plc4x/java/utils/cache/ConnectionContainer.java: ########## @@ -54,8 +62,19 @@ public synchronized Future<PlcConnection> lease() { } return connectionFuture; } - + public synchronized void close(){ + CompletableFuture<PlcConnection> leaseFuture; + while((leaseFuture = queue.poll())!=null){ + leaseFuture.complete(null); Review Comment: Wouldn't it make more sense to complete exceptionally instead of returning null? We are currently expecting the result of a getConnection() to be a usable connection or an exception ... returning "null" sort of doesn't match that contract. I would change it to "completeExceptionally" -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@plc4x.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org