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

Close stdin for some processes #9178

Merged
merged 1 commit into from Jul 9, 2021
Merged

Conversation

psteckler
Copy link
Member

@psteckler psteckler commented Jul 9, 2021

Issue #9163 suggests that there's a FIFO leak in the code. When child processes terminate, the Mina executable should close stdin, its end of the pipe shared with those processes.

For libp2p, the start_custom code already does a close on termination. For the SNARK worker and verifier, this PR introduces explicit closes.

Tested that the code for the verifier is exercised by running a local network, killing the verifier, and printing out the closed status of all 3 file descriptors. Only the stdin was open. (Also verified that the closes for libp2p helper are being called. Probably the one for stdout isn't needed.)

(In fact, in one case, all 3 descriptors remained open, but I'm supposing that's a race where the stdout and stderr had not yet been automatically closed.)

@psteckler psteckler requested a review from a team as a code owner July 9, 2021 21:55
@psteckler psteckler added the ci-build-me Add this label to trigger a circle+buildkite build for this branch label Jul 9, 2021
@mrmr1993
Copy link
Member

mrmr1993 commented Jul 9, 2021

For libp2p, the start_custom code already does a close on termination. For the SNARK worker and verifier, this PR introduces explicit closes.

Can you link to where this is done, for completeness?

@psteckler
Copy link
Member Author

For libp2p, the start_custom code already does a close on termination. For the SNARK worker and verifier, this PR introduces explicit closes.

Can you link to where this is done, for completeness?

https://github.com/MinaProtocol/mina/blob/release/1.2.0/src/lib/child_processes/child_processes.ml#L328

@mrmr1993 mrmr1993 merged commit 20dcff9 into release/1.2.0 Jul 9, 2021
@mrmr1993 mrmr1993 deleted the fix/close-stdin-processes branch July 9, 2021 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-build-me Add this label to trigger a circle+buildkite build for this branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants