[SERVER-26910] provide a global lock around process creation in shell_utils_launcher Created: 04/Nov/16  Updated: 28/Nov/16  Resolved: 07/Nov/16

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: 3.4.0-rc3

Type: Bug Priority: Major - P3
Reporter: Mira Carey Assignee: Mira Carey
Resolution: Done Votes: 0
Labels: platforms-hocr
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 2016-11-21
Participants:
Linked BF Score: 0

 Description   

The shell process management functions fork()/exec() in a multi-threaded program without sufficient guards to avoid leaking fds into children. This causes deadlocks around the program registry (as we rely on file descriptor closure to break us out of dedicated child threads which read child output).

The fix is to use a global lock to guard us from before the call to pipe() until after we close write side of the pipe in the parent.



 Comments   
Comment by Githook User [ 07/Nov/16 ]

Author:

{u'username': u'hanumantmk', u'name': u'Jason Carey', u'email': u'jcarey@argv.me'}

Message: SERVER-26910 lock around fork() in shell launcher

The shell process management functions fork()/exec() in a multi-threaded
program without sufficient guards to avoid leaking fds into children.
This causes deadlocks around the program registry (as we rely on file
descriptor closure to break us out of dedicated child threads which read
child output).

The fix is to use a global lock to guard us from before the call to
pipe() until after we close write side of the pipe in the parent.
Branch: master
https://github.com/mongodb/mongo/commit/ac465d21d85dfde7d55764cb714d8e235c22383f

Generated at Thu Feb 08 04:13:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.