@Override
    public void close() {
        synchronized (lock) {
            next = null;
            wakeupProducer = false;

            if (error == null) {
                error = new ClosedException();
            }
            lock.notifyAll();
        }
    }
Closes the handover. Both the {@link #produce(List)} method and the {@link #pollNext()} will
throw a {@link ClosedException} on any currently blocking and future invocations.

<p>If an exception was previously reported via the {@link #reportError(Throwable)} method,
that exception will not be overridden. The consumer thread will throw that exception upon
calling {@link #pollNext()}, rather than the {@code ClosedException}.</p>
inlong-sort/sort-flink/cdc-base/src/main/java/org/apache/inlong/sort/cdc/base/debezium/internal/Handover.java