code: def _log_future_exception(future, logger):
      
  
      if not future.done():
          return
  
      try:
          future.result()
      except:  #pylint:disable=bare-except;This is a background logging helper
          logger.warning("Exception in ignored future: %s", future, exc_info=True)
docs: Log any exception raised by future.