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

Remove node-pipe dependency #2956

Merged
merged 1 commit into from
Jan 8, 2024
Merged

Remove node-pipe dependency #2956

merged 1 commit into from
Jan 8, 2024

Conversation

nwt
Copy link
Member

@nwt nwt commented Jan 8, 2024

Rely on child_process.spawn() to create a pipe instead.

Closes #1165.

Rely on Node to create a pipe instead.
@nwt nwt requested review from mattnibs, jameskerr and philrz January 8, 2024 20:37
@nwt
Copy link
Member Author

nwt commented Jan 8, 2024

To verify that zed serve still exits when the Electron process receives SIGKILL on macOS, I started Zui in one terminal with

$ yarn start

and then did the following in a second terminal.

$ pgrep -fl 'zed serve'
41685 /Users/noah/brimdata/zui/apps/zui/zdeps/zed serve -l :9867 -lake /Users/noah/brimdata/zui/apps/zui/run/lake -log.level=info -log.filemode=rotate -log.path /Users/noah/brimdata/zui/apps/zui/run/logs/zlake.log --cors.origin=* -brimfd=3
$ pgrep -fl '/zui/.*/Electron \.'
41676 /Users/noah/brimdata/zui/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron .
$ pkill -9 -f '/zui/.*/Electron \.'
$ pgrep -fl '/zui/.*/Electron \.'
$ pgrep -fl 'zed serve'

@nwt nwt merged commit 697f467 into main Jan 8, 2024
3 checks passed
@nwt nwt deleted the remove-node-pipe branch January 8, 2024 21:26
nwt added a commit that referenced this pull request Jan 8, 2024
This reverts commit d29e674.

Reason for revert: #2956 removed the node-pipe dependency so this
workaround for #2882 is no longer necessary.
nwt added a commit that referenced this pull request Jan 8, 2024
This reverts commit d29e674.

Reason for revert: #2956 removed the node-pipe dependency so this
workaround for #2882 is no longer necessary.
@philrz
Copy link
Contributor

philrz commented Jan 9, 2024

Now that this has merged, I've verified it on all our supported OSes with Zui Insiders 1.5.1-8 using the same approach as from #1018 (comment). In all cases the abrupt killing of the parent Zui Insiders process trigged the subsequent disappearance of the corresponding zed serve process.

macOS

$ ps auxww | grep -i zui
phil             59907   0.0  0.0 34130576    728 s001  S+    4:10PM   0:00.00 grep -i zui
phil             59894   0.0  0.6 1219838092  98104   ??  S     4:10PM   0:00.57 /Applications/Zui - Insiders.app/Contents/Frameworks/Zui - Insiders Helper (Renderer).app/Contents/MacOS/Zui - Insiders Helper (Renderer) --type=renderer --user-data-dir=/Users/phil/Library/Application Support/Zui - Insiders --app-path=/Applications/Zui - Insiders.app/Contents/Resources/app.asar --enable-sandbox --disable-gpu-compositing --lang=en-US --num-raster-threads=4 --enable-zero-copy --enable-gpu-memory-buffer-compositor-resources --enable-main-frame-before-activation --renderer-client-id=5 --time-ticks-at-unix-epoch=-1703134525972949 --launch-time-ticks=1624509642615 --shared-files --field-trial-handle=1718379636,r,693411961665723902,11632877364170192738,262144 --enable-features=kWebSQLAccess --disable-features=SpareRendererForSitePerProcess --variations-seed-version --seatbelt-client=65
phil             59893   0.0  0.8 1219848152 130008   ??  S     4:10PM   0:00.98 /Applications/Zui - Insiders.app/Contents/Frameworks/Zui - Insiders Helper (Renderer).app/Contents/MacOS/Zui - Insiders Helper (Renderer) --type=renderer --user-data-dir=/Users/phil/Library/Application Support/Zui - Insiders --app-path=/Applications/Zui - Insiders.app/Contents/Resources/app.asar --enable-sandbox --first-renderer-process --disable-gpu-compositing --lang=en-US --num-raster-threads=4 --enable-zero-copy --enable-gpu-memory-buffer-compositor-resources --enable-main-frame-before-activation --renderer-client-id=4 --time-ticks-at-unix-epoch=-1703134525972949 --launch-time-ticks=1624509266472 --shared-files --field-trial-handle=1718379636,r,693411961665723902,11632877364170192738,262144 --enable-features=kWebSQLAccess --disable-features=SpareRendererForSitePerProcess --variations-seed-version --seatbelt-client=52
phil             59888   0.0  0.1 35009800  20832   ??  S     4:10PM   0:00.11 /Applications/Zui - Insiders.app/Contents/Resources/app.asar.unpacked/zdeps/zed serve -l :9988 -lake /Users/phil/Library/Application Support/Zui - Insiders/lake -log.level=info -log.filemode=rotate -log.path /Users/phil/Library/Application Support/Zui - Insiders/logs/zlake.log --cors.origin=* -brimfd=3
phil             59877   0.0  0.2 67592116  30084   ??  S     4:10PM   0:00.28 /Applications/Zui - Insiders.app/Contents/Frameworks/Zui - Insiders Helper.app/Contents/MacOS/Zui - Insiders Helper --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --user-data-dir=/Users/phil/Library/Application Support/Zui - Insiders --shared-files --field-trial-handle=1718379636,r,693411961665723902,11632877364170192738,262144 --enable-features=kWebSQLAccess --disable-features=SpareRendererForSitePerProcess --variations-seed-version --seatbelt-client=42
phil             59875   0.0  0.3 67633408  47128   ??  S     4:10PM   0:00.28 /Applications/Zui - Insiders.app/Contents/Frameworks/Zui - Insiders Helper (GPU).app/Contents/MacOS/Zui - Insiders Helper (GPU) --type=gpu-process --user-data-dir=/Users/phil/Library/Application Support/Zui - Insiders --gpu-preferences=WAAAAAAAAAAgAAAEAAAAAAAAAAAAAAAAAABgAAAAAAA4AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaAcAAAAAAABoBwAAAAAAAHgCAABOAAAAcAIAAAAAAAB4AgAAAAAAAIACAAAAAAAAiAIAAAAAAACQAgAAAAAAAJgCAAAAAAAAoAIAAAAAAACoAgAAAAAAALACAAAAAAAAuAIAAAAAAADAAgAAAAAAAMgCAAAAAAAA0AIAAAAAAADYAgAAAAAAAOACAAAAAAAA6AIAAAAAAADwAgAAAAAAAPgCAAAAAAAAAAMAAAAAAAAIAwAAAAAAABADAAAAAAAAGAMAAAAAAAAgAwAAAAAAACgDAAAAAAAAMAMAAAAAAAA4AwAAAAAAAEADAAAAAAAASAMAAAAAAABQAwAAAAAAAFgDAAAAAAAAYAMAAAAAAABoAwAAAAAAAHADAAAAAAAAeAMAAAAAAACAAwAAAAAAAIgDAAAAAAAAkAMAAAAAAACYAwAAAAAAAKADAAAAAAAAqAMAAAAAAACwAwAAAAA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AABAAAAAcAAAAQAAAAAAAAAAQAAAAIAAAAEAAAAAAAAAAEAAAACQAAABAAAAAAAAAABAAAAAsAAAAQAAAAAAAAAAQAAAAMAAAAEAAAAAAAAAAEAAAADgAAABAAAAAAAAAABAAAAA8AAAAQAAAAAAAAAAQAAAAQAAAAEAAAAAAAAAAHAAAAAAAAABAAAAAAAAAABwAAAAEAAAAQAAAAAAAAAAcAAAACAAAAEAAAAAAAAAAHAAAAAwAAABAAAAAAAAAABwAAAAYAAAAQAAAAAAAAAAcAAAAHAAAAEAAAAAAAAAAHAAAACAAAABAAAAAAAAAABwAAAAkAAAAQAAAAAAAAAAcAAAALAAAAEAAAAAAAAAAHAAAADAAAABAAAAAAAAAABwAAAA4AAAAQAAAAAAAAAAcAAAAPAAAAEAAAAAAAAAAHAAAAEAAAABAAAAAAAAAACAAAAAAAAAAQAAAAAAAAAAgAAAABAAAAEAAAAAAAAAAIAAAAAgAAABAAAAAAAAAACAAAAAMAAAAQAAAAAAAAAAgAAAAGAAAAEAAAAAAAAAAIAAAABwAAABAAAAAAAAAACAAAAAgAAAAQAAAAAAAAAAgAAAAJAAAAEAAAAAAAAAAIAAAACwAAABAAAAAAAAAACAAAAAwAAAAQAAAAAAAAAAgAAAAOAAAAEAAAAAAAAAAIAAAADwAAABAAAAAAAAAACAAAABAAAAAQAAAAAAAAAAoAAAAAAAAAEAAAAAAAAAAKAAAAAQAAABAAAAAAAAAACgAAAAIAAAAQAAAAAAAAAAoAAAADAAAAEAAAAAAAAAAKAAAABgAAABAAAAAAAAAACgAAAAcAAAAQAAAAAAAAAAoAAAAIAAAAEAAAAAAAAAAKAAAACQAAABAAAAAAAAAACgAAAAsAAAAQAAAAAAAAAAoAAAAMAAAAEAAAAAAAAAAKAAAADgAAABAAAAAAAAAACgAAAA8AAAAQAAAAAAAAAAoAAAAQAAAACAAAAAAAAAAIAAAAAAAAAA== --use-gl=angle --use-angle=swiftshader-webgl --shared-files --field-trial-handle=1718379636,r,693411961665723902,11632877364170192738,262144 --enable-features=kWebSQLAccess --disable-features=SpareRendererForSitePerProcess --variations-seed-version --seatbelt-client=40
phil             59873   0.0  0.7 1211812160 115428   ??  S     4:10PM   0:01.26 /Applications/Zui - Insiders.app/Contents/MacOS/Zui - Insiders

$ kill -9 59873

$ ps auxww | grep -i zui
phil             59913   0.0  0.0 34121360    688 s001  S+    4:11PM   0:00.00 grep -i zui

Linux

$ ps auxww | grep -i zui
phil        2754 16.1  5.9 978732 239460 ?       Sl   16:03   0:26 /snap/snap-store/959/usr/bin/snap-store --local-filename /home/phil/Downloads/zui-insiders_1.5.1-8_amd64.deb
phil        4105  2.2  4.0 1177926332 161160 ?   Sl   16:05   0:01 /opt/Zui - Insiders/zui-insiders
phil        4109  0.0  1.2 33801340 51652 ?      S    16:05   0:00 /opt/Zui - Insiders/zui-insiders --type=zygote --no-zygote-sandbox
phil        4110  0.0  1.2 33801328 50156 ?      S    16:05   0:00 /opt/Zui - Insiders/zui-insiders --type=zygote
phil        4112  0.0  0.3 33801356 13012 ?      S    16:05   0:00 /opt/Zui - Insiders/zui-insiders --type=zygote
phil        4138  0.3  2.3 34028520 93692 ?      Sl   16:05   0:00 /opt/Zui - Insiders/zui-insiders --type=gpu-process --enable-crash-reporter=5ce26896-b051-4690-b74f-a63023da0fe3,no_channel --user-data-dir=/home/phil/.config/Zui - Insiders --gpu-preferences=WAAAAAAAAAAgAAAEAAAAAAAAAAAAAAAAAABgAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAGAAAAAAAAAAYAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAIAAAAAAAAAA== --use-gl=angle --use-angle=swiftshader-webgl --shared-files --field-trial-handle=0,i,1080159917898229357,11955431290700256853,262144 --enable-features=kWebSQLAccess --disable-features=SpareRendererForSitePerProcess --variations-seed-version
phil        4148  0.5  1.8 33853292 74140 ?      Sl   16:05   0:00 /opt/Zui - Insiders/zui-insiders --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --enable-crash-reporter=5ce26896-b051-4690-b74f-a63023da0fe3,no_channel --user-data-dir=/home/phil/.config/Zui - Insiders --shared-files=v8_context_snapshot_data:100 --field-trial-handle=0,i,1080159917898229357,11955431290700256853,262144 --enable-features=kWebSQLAccess --disable-features=SpareRendererForSitePerProcess --variations-seed-version
phil        4155  0.1  0.7 1936836 29332 ?       Sl   16:05   0:00 /opt/Zui - Insiders/resources/app.asar.unpacked/zdeps/zed serve -l :9988 -lake /home/phil/.config/Zui - Insiders/lake -log.level=info -log.filemode=rotate -log.path /home/phil/.config/Zui - Insiders/logs/zlake.log --cors.origin=* -brimfd=3
phil        4184  2.3  3.2 1186086400 131208 ?   Sl   16:05   0:01 /opt/Zui - Insiders/zui-insiders --type=renderer --enable-crash-reporter=5ce26896-b051-4690-b74f-a63023da0fe3,no_channel --user-data-dir=/home/phil/.config/Zui - Insiders --app-path=/opt/Zui - Insiders/resources/app.asar --enable-sandbox --first-renderer-process --disable-gpu-compositing --lang=en-US --num-raster-threads=2 --enable-main-frame-before-activation --renderer-client-id=4 --time-ticks-at-unix-epoch=-1704758539484180 --launch-time-ticks=205389042 --shared-files=v8_context_snapshot_data:100 --field-trial-handle=0,i,1080159917898229357,11955431290700256853,262144 --enable-features=kWebSQLAccess --disable-features=SpareRendererForSitePerProcess --variations-seed-version
phil        4207  1.3  2.8 1186091996 115472 ?   Sl   16:05   0:00 /opt/Zui - Insiders/zui-insiders --type=renderer --enable-crash-reporter=5ce26896-b051-4690-b74f-a63023da0fe3,no_channel --user-data-dir=/home/phil/.config/Zui - Insiders --app-path=/opt/Zui - Insiders/resources/app.asar --enable-sandbox --disable-gpu-compositing --lang=en-US --num-raster-threads=2 --enable-main-frame-before-activation --renderer-client-id=5 --time-ticks-at-unix-epoch=-1704758539484180 --launch-time-ticks=205881440 --shared-files=v8_context_snapshot_data:100 --field-trial-handle=0,i,1080159917898229357,11955431290700256853,262144 --enable-features=kWebSQLAccess --disable-features=SpareRendererForSitePerProcess --variations-seed-version
phil        4360  0.0  0.0   8908   720 pts/0    S+   16:06   0:00 grep --color=auto -i zui

$ kill -9 4105

phil@phil-VirtualBox:~$ ps auxww | grep -i zui
phil        2754 14.2  5.9 978732 239460 ?       Sl   16:03   0:26 /snap/snap-store/959/usr/bin/snap-store --local-filename /home/phil/Downloads/zui-insiders_1.5.1-8_amd64.deb
phil        4577  0.0  0.0   8908   648 pts/0    S+   16:07   0:00 grep --color=auto -i zui

Windows

Verify.mp4

Thanks @nwt!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-windows platform: Fail build/install if Node Pipe does not exist
3 participants