mirror of
https://github.com/explosion/spaCy.git
synced 2025-03-22 02:44:15 +03:00
Test if closing explicitly solves recursive lock issues
This commit is contained in:
parent
d84068e460
commit
2d4067d021
|
@ -1716,6 +1716,7 @@ class Language:
|
||||||
# is done, so that they can exit gracefully.
|
# is done, so that they can exit gracefully.
|
||||||
for q in texts_q:
|
for q in texts_q:
|
||||||
q.put(_WORK_DONE_SENTINEL)
|
q.put(_WORK_DONE_SENTINEL)
|
||||||
|
q.close()
|
||||||
|
|
||||||
# Otherwise, we are stopping because the error handler raised an
|
# Otherwise, we are stopping because the error handler raised an
|
||||||
# exception. The sentinel will be last to go out of the queue.
|
# exception. The sentinel will be last to go out of the queue.
|
||||||
|
@ -2347,7 +2348,8 @@ def _apply_pipes(
|
||||||
|
|
||||||
# Stop working if we encounter the end-of-work sentinel.
|
# Stop working if we encounter the end-of-work sentinel.
|
||||||
if isinstance(texts_with_ctx, _WorkDoneSentinel):
|
if isinstance(texts_with_ctx, _WorkDoneSentinel):
|
||||||
return
|
sender.close()
|
||||||
|
receiver.close()
|
||||||
|
|
||||||
docs = (
|
docs = (
|
||||||
ensure_doc(doc_like, context) for doc_like, context in texts_with_ctx
|
ensure_doc(doc_like, context) for doc_like, context in texts_with_ctx
|
||||||
|
@ -2371,7 +2373,8 @@ def _apply_pipes(
|
||||||
# Parent has closed the pipe prematurely. This happens when a
|
# Parent has closed the pipe prematurely. This happens when a
|
||||||
# worker encounters an error and the error handler is set to
|
# worker encounters an error and the error handler is set to
|
||||||
# stop processing.
|
# stop processing.
|
||||||
return
|
sender.close()
|
||||||
|
receiver.close()
|
||||||
|
|
||||||
|
|
||||||
class _Sender:
|
class _Sender:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user