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

Conversation

ThePletch
Copy link
Contributor

Description

Adds a call to explicitly close() the task result queue when a worker exits, rather than waiting for the worker to be garbage collected.

Motivation and Context

There are certain contexts (e.g. during test runs on certain architectures) where a worker may not be garbage collected until significantly after it exits. In test suites affected by this, running many Luigi tasks via the local scheduler can cause the test suite to break due to exceeding the system's open files threshold (as each task result queue uses a separate file-based semaphore). This fails all tests after the threshold is reached. Explicitly closing the task result queue when a worker exits ensures that the queue is not held open unnecessarily. Due to the behavior of close(), this should not close the queue for other producers/consumers, only the worker in question.

Have you tested this? If so, how?

After making this change and re-running my test suite, the 'too many open files' issue is no longer present.

@ThePletch ThePletch force-pushed the sjp-garbage-collect-result-queue branch from 1b724f1 to 9315a4c Compare July 20, 2020 17:30
@ThePletch
Copy link
Contributor Author

Looks like this breaks a test. I'll investigate the failing test later this week.

@ThePletch
Copy link
Contributor Author
ThePletch commented Aug 10, 2020

Looks like tests are passing but my PR is breaking due to upstream changes that aren't covered by tests. I don't think there's much I can do about those.

Rebase fixed it. Ready for review.

@ThePletch ThePletch force-pushed the sjp-garbage-collect-result-queue branch from b1adb51 to daee476 Compare August 10, 2020 15:52
Copy link
Collaborator
@dlstadther dlstadther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable to me

@ThePletch
Copy link
Contributor Author

@dlstadther Any word on this getting released? It'll make running our full test suite locally possible, so I'm anxious for it to get out.

@dlstadther
Copy link
Collaborator

@ThePletch I can merge it and make it available from master. But it'll be up to @honnix and the folks at Spotify to push out the next release. I haven't been as involved and so leaving releases up to them.

@dlstadther dlstadther merged commit 7d16f29 into spotify:master Sep 1, 2020
@ThePletch ThePletch deleted the sjp-garbage-collect-result-queue branch September 1, 2020 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0