message: tf-session: run session.close() in a thread when handling an exception.
diff: @@ -1590,6 +1590,20 @@ class Session(BaseSession):
  self._default_session_context_manager = None
  self._default_graph_context_manager = None
  + # If we are closing due to an exception, set a time limit on our Close() to
  + # avoid blocking forever.
  + # TODO(b/120204635) remove this when deadlock is fixed.
  + if exec_type:
  + close_thread = threading.Thread(
  + name='SessionCloseThread', target=self.close)
  + close_thread.daemon = True
  + close_thread.start()
  + close_thread.join(30.0)
  + if close_thread.is_alive():
  + logging.error(
  + 'Session failed to close after 30 seconds. Continuing after this '
  + 'point may leave your program in an undefined state.')
  + else:
  self.close()
  @staticmethod
  