8000 Garbage collect task result queue when worker context exits by ThePletch · Pull Request #2973 · spotify/luigi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Garbage collect task result queue when worker context exits #2973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions luigi/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ def __exit__(self, type, value, traceback):
for task in self._running_tasks.values():
if task.is_alive():
task.terminate()
self._task_result_queue.close()
return False # Don't suppress exception

def _generate_worker_info(self):
Expand Down
6 changes: 3 additions & 3 deletions test/worker_external_task_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ def test_external_task_complete_but_missing_dep_at_runtime(self):
# split up scheduling task and running to simulate runtime scenario
with self._make_worker() as w:
w.add(test_task)
# touch output so test_task should be considered complete at runtime
open(test_task.output_path, 'a').close()
success = w.run()
# touch output so test_task should be considered complete at runtime
open(test_task.output_path, 'a').close()
success = w.run()

self.assertTrue(success)
# upstream dependency output didn't exist at runtime
Expand Down
0