private void waitForFuturesToComplete()

in flink-connector-gcp-pubsub/src/main/java/org/apache/flink/streaming/connectors/gcp/pubsub/PubSubSink.java [216:231]


    private void waitForFuturesToComplete() {
        // We have to synchronize on numPendingFutures here to ensure the notification won't be
        // missed.
        synchronized (numPendingFutures) {
            while (isRunning && numPendingFutures.get() > 0) {
                try {
                    numPendingFutures.wait();
                } catch (InterruptedException e) {
                    // Simply cache the interrupted exception. Supposedly the thread will exit the
                    // loop
                    // gracefully when it checks the isRunning flag.
                    LOG.info("Interrupted when waiting for futures to complete");
                }
            }
        }
    }