[9.1] fix: create the RequestExecutingAgent ProcessPool in initialize - #8766
Draft
chrisburr wants to merge 1 commit into
Draft
[9.1] fix: create the RequestExecutingAgent ProcessPool in initialize#8766chrisburr wants to merge 1 commit into
chrisburr wants to merge 1 commit into
Conversation
ProcessPool was built lazily on the first processPool() call, which happens inside execute(), after getBulkRequests() has already loaded a whole BulkRequest into memory. All MinProcess workers are forked at that instant, and because a worker never unwinds the frame it was forked from, every one of them pins that cycle's Requests for the lifetime of the agent. A core dump of one worker from a 60-process pool running BulkRequest=3000 still held the parent's requestsToExecute list and getRequests dict: 3003 Request, 3764 Operation and 40973 File objects, 54.8 MiB of live data in a process that only ever handles one request at a time. Creating the pool at the end of initialize() forks from the main thread before any request is fetched, and keeps the RequestDB engine out of the workers as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fork the REA process pool earlier in the agent process to avoid wasting as much memory on each subprocess.
BEGINRELEASENOTES
*RequestManagemet
FIX: Reduce memory usage of RequestExecutingAgent
ENDRELEASENOTES