in alloydb-jdbc-connector/src/main/java/com/google/cloud/alloydb/Refresher.java [287:305]
void close() {
synchronized (connectionInfoGuard) {
if (closed) {
return;
}
// Cancel any in-progress requests
if (!this.current.isDone()) {
this.current.cancel(true);
}
if (!this.next.isDone()) {
this.next.cancel(true);
}
this.current = Futures.immediateFailedFuture(new RuntimeException("Connection is closed."));
this.closed = true;
}
}