seamless-medley/medley

A lot of zombie process while running in container with mongodb version below 5

visualizeq opened this issue · 3 comments

Found a lot of zombie process (sh) in container that got fork from ts-node

sh(1)---node(9)-+-sh(20)---node(21)-+-node(33)-+-sh(71)
                |                   |          |-sh(72)
                |                   |          |-sh(74)
                |                   |          |-sh(75)
                |                   |          |-sh(76)
                |                   |          |-sh(77)
                |                   |          |-sh(78)
                |                   |          |-sh(79)
                |                   |          |-sh(80)
                |                   |          |-sh(81)
                |                   |          |-sh(82)
                |                   |          |-sh(83)
                |                   |          |-sh(84)
                |                   |          |-sh(85)
                |                   |          |-sh(86)
                |                   |          |-sh(87)
                |                   |          |-sh(88)
                |                   |          |-sh(89)
                |                   |          |-sh(90)
                |                   |          |-sh(91)
                |                   |          |-sh(92)
                |                   |          |-sh(93)
                |                   |          |-sh(94)
                |                   |          |-sh(95)
                |                   |          |-sh(96)
                |                   |          |-sh(97)
                |                   |          |-sh(98)
                |                   |          |-sh(99)
                |                   |          |-sh(100)
                |                   |          |-sh(101)
                |                   |          |-sh(102)
                |                   |          |-sh(103)
                |                   |          |-sh(104)
                |                   |          |-sh(105)
                |                   |          |-sh(106)
                |                   |          |-sh(107)
                |                   |          |-sh(108)
                |                   |          |-sh(113)
                |                   |          |-sh(114)
                |                   |          |-sh(116)
                |                   |          |-sh(117)
                |                   |          |-sh(119)
                |                   |          |-sh(120)
                |                   |          |-sh(126)
                |                   |          |-sh(127)
                |                   |          |-sh(129)
                |                   |          |-sh(130)
                |                   |          |-sh(131)
                |                   |          |-sh(132)
                |                   |          |-sh(133)
                |                   |          |-sh(134)
                |                   |          |-sh(136)
                |                   |          |-sh(137)
                |                   |          |-sh(139)
                |                   |          |-sh(140)
                |                   |          |-sh(141)
                |                   |          |-sh(142)
                |                   |          |-sh(143)
                |                   |          |-sh(144)
                |                   |          |-sh(147)
                |                   |          |-sh(148)
                |                   |          |-sh(149)
                |                   |          |-sh(150)
                |                   |          |-sh(152)
                |                   |          |-sh(153)
                |                   |          |-sh(157)
                |                   |          |-sh(158)
                |                   |          |-sh(168)
                |                   |          |-sh(169)
                |                   |          |-sh(171)
                |                   |          |-sh(172)
                |                   |          |-sh(173)
                |                   |          |-sh(174)
                |                   |          |-sh(182)
                |                   |          |-sh(183)
                |                   |          |-sh(193)
                |                   |          |-sh(194)
                |                   |          |-{node}(39)
                |                   |          |-{node}(40)
                |                   |          |-{node}(41)
                |                   |          |-{node}(42)
                |                   |          |-{node}(43)
                |                   |          |-{node}(44)
                |                   |          |-{node}(56)
                |                   |          |-{node}(57)
                |                   |          |-{node}(58)
                |                   |          |-{node}(59)
                |                   |          |-{node}(60)
                |                   |          |-{node}(61)
                |                   |          |-{node}(62)
                |                   |          |-{node}(63)
                |                   |          |-{node}(64)
                |                   |          |-{node}(65)
                |                   |          |-{node}(66)
                |                   |          |-{node}(67)
                |                   |          |-{node}(68)
                |                   |          |-{node}(70)
                |                   |          |-{node}(73)
                |                   |          |-{node}(145)
                |                   |          `-{node}(146)
                |                   |-{node}(27)
                |                   |-{node}(28)
                |                   |-{node}(29)
                |                   |-{node}(30)
                |                   |-{node}(31)
                |                   `-{node}(32)
                |-{node}(10)
                |-{node}(11)
                |-{node}(12)
                |-{node}(13)
                |-{node}(14)
                |-{node}(15)
                |-{node}(16)
                |-{node}(17)
                |-{node}(18)
                `-{node}(19)

after trying to reproduce i found that zombie process not related to mongodb version but it is about file watcher process during runtime
https://github.com/vittee/medley/blob/97cb5f020e3e1c37dfbe3d5a68f6e49490c146f7/packages/core/src/collections/watch.ts#L30-L36
and found that line 32 zombie process will increase significant! https://github.com/vittee/medley/blob/97cb5f020e3e1c37dfbe3d5a68f6e49490c146f7/packages/core/src/collections/watch.ts#L30-L36

This seems to be causing by parcel-bundler/watcher which somehow introduce a zombie process when trying to watch with watchman unavailable.

Fixed in 7df5669