Skip to content
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

Avoid zombie processes on parallel build fail #11923

Merged
merged 2 commits into from Feb 3, 2024

Conversation

felixvd
Copy link
Contributor

@felixvd felixvd commented Jan 31, 2024

Subject: Terminate processes correctly when parallel build fails

Feature or Bugfix

  • Bugfix

Purpose

On our build servers, we have had recurring (every 1-4 weeks) and hard-to-reproduce issues with sphinx builds that do not terminate. We have applied the change in this MR and have seen no reoccurrence of the error.

Detail

Without this change, this error message used to appear in our build logs at rare times:

Exception occurred:
  File "/usr/lib/python3.9/multiprocessing/popen_fork.py", line 66, in _launch
    self.pid = os.fork()
OSError: [Errno 12] Cannot allocate memory

I assume that when one of the threads dies, it cannot be joined and the build hangs.

Sadly, I lost most of the logs for and description of the original issue. All I know is that this change fixed the issue for us to the best of our knowledge.

I apologize for the lack of documentation, but I hope this can be merged nonetheless.

Relates

cc @cielavenir

except Exception:
# shutdown other child processes on failure
# (e.g. OSError: Failed to allocate memory)
self.terminate()
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering whether we should re-raise or not.

@AA-Turner AA-Turner merged commit ceb3b2a into sphinx-doc:master Feb 3, 2024
21 of 22 checks passed
@AA-Turner
Copy link
Member

Thanks Felix!

A

@felixvd
Copy link
Contributor Author

felixvd commented Feb 4, 2024 via email

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants