Skip to content

Commit 70deb34

Browse files
committed
[stream-refactor] stop leaking FD 100 for the life of the child
This prevents successful detachment since [stream-refactor] landed
1 parent f304ab8 commit 70deb34

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mitogen/core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3594,7 +3594,10 @@ def _setup_master(self):
35943594
else:
35953595
self.parent = Context(self.router, parent_id, 'parent')
35963596

3597-
in_fp = os.fdopen(os.dup(self.config.get('in_fd', 100)), 'rb', 0)
3597+
in_fd = self.config.get('in_fd', 100)
3598+
in_fp = os.fdopen(os.dup(in_fd), 'rb', 0)
3599+
os.close(in_fd)
3600+
35983601
out_fp = os.fdopen(os.dup(self.config.get('out_fd', 1)), 'wb', 0)
35993602
self.stream = MitogenProtocol.build_stream(self.router, parent_id)
36003603
self.stream.accept(in_fp, out_fp)

0 commit comments

Comments
 (0)