message: Close session on infeed error.  This should fix most of the cases where the client process hangs waiting for the main training loop to exit.
diff: @@ -312,6 +312,7 @@ class _InfeedThreadController(_InfeedOutfeedThreadBaseController):
  def _input_thread_fn_for_loading(self, session, enqueue_ops):
  count = 0
  + try:
  while True:
  signal = self._signal_queue.get()
  if signal == _SIGNAL.STOP:
  @@ -323,6 +324,13 @@ class _InfeedThreadController(_InfeedOutfeedThreadBaseController):
  logging.debug('Infeed enqueue for iteration (%d, %d)', count, i)
  session.run(enqueue_ops)
  count += 1
  + except Exception: # pylint: disable=broad-except
  + logging.error(
  + 'Failed running infeed, closing session.\n'
  + 'You may see an exception from your main session after this.',
  + exc_info=1
  + )
  + session.close()
  def join(self):
  logging.info('Waiting for Infeed Thread to exit.')
  