Avoid os.fork() prior to stats upload.#4919
Merged
Merged
Conversation
stuhood
approved these changes
Sep 30, 2017
stuhood
left a comment
Member
There was a problem hiding this comment.
Thanks Kris.
Maybe (re)open an issue about making stats posting async? As mentioned offline, doing something with a persistent queue or the sqlite db we already have, would be good.
Member
Author
|
sure, created #4920 |
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.
Problem
Presently, we do an
os.fork()just before posting build stats in order to reduce the time-until-timeout for users who aren't connected to the VPN (and thus can't reach the stats server).For users on OSX 10.11 (and potentially others), this seems to have been causing a silent segmentation fault in the forked process due to https://bugs.python.org/issue13829 .
With the addition of
faulthandlersupport to pants, we now see a full traceback to stderr when this segmentation fault happens in the forked process due to retaining handles to the original processes stdio descriptors. At first this appeared to be a new issue encountered during release handling, but after investigating it seems like it's justfaulthandler's improved logging revealing a long-standing masked segfault.Solution
Remove the
os.fork()call prior to stats upload and revisit.Result
Can no longer reproduce the segmentation fault.