void refresh()

in src/main/java/org/apache/skywalking/banyandb/v1/client/grpc/channel/ChannelManager.java [87:100]


    void refresh() throws IOException {
        Entry entry = entryRef.get();
        if (!entry.needReconnect) {
            return;
        }
        if (entry.isConnected(entry.reconnectCount.incrementAndGet() > this.settings.forceReconnectionThreshold())) {
            // Reconnect to the same server is automatically done by GRPC
            // clear the flags
            entry.reset();
            return;
        }
        Entry replacedEntry = entryRef.getAndSet(new Entry(this.channelFactory.create()));
        replacedEntry.shutdown();
    }