def METHOD_NAME(self):
    while self._finalizers:
        func, args, kwargs = self._finalizers.popleft()
        func_repr = self._format_callback(func, args, kwargs)
        try:
            log.trace("Calling finalizer %s", func_repr)
            func(*args, **kwargs)
        except Exception as exc:  # pylint: disable=broad-except
            log.error(
                "Failed to run finalizer %s: %s",
                func_repr,
                exc,
                exc_info=True,
            )