Skip to content

Commit

Permalink
Handle queue errors in streaming dataset reader (#19167)
Browse files Browse the repository at this point in the history
  • Loading branch information
awaelchli authored Jan 15, 2024
1 parent 661c181 commit 628ee0c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/lightning/data/streaming/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,12 @@ def _get_from_queue(queue: multiprocessing.Queue, timeout: float = _DEFAULT_TIME
return queue.get(timeout=timeout)
except Empty:
pass
except OSError as e:
except OSError as err:
# handle closed queue before the thread terminates
if "handle is closed" in str(e):
logger.debug(e)
if "handle is closed" in str(err) or "Bad file descriptor" in str(err):
logger.debug(err)
else:
raise e
raise err
except EOFError as err:
logger.debug(err)
return None

0 comments on commit 628ee0c

Please sign in to comment.