@Override
    @SuppressWarnings("deprecation")  // finalize() is deprecated from Java 9
    protected void finalize() throws Throwable {
        try {
            if (!isClosed()) {
                log.log(WARNING, stackTraceAtConstruction,
                        () -> String.format("%s: Closing subscription from finalizer() - close() has not been called (keys=%s)",
                                            super.toString(),
                                            subscriptionHandles.stream().map(handle -> handle.subscription().getKey().toString()).toList()));
                close();
            }
        } finally {
            super.finalize();
        }
    }
Finalizer to ensure that we do not leak resources on reconfig. Though finalizers are bad,
this is not a performance critical object as it will be deconstructed typically container reconfig.
config/src/main/java/com/yahoo/config/subscription/ConfigSubscriber.java