fix: meta dev does not exit properly upon SIGTERM#895
Conversation
|
A few remarks so far,
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #895 +/- ##
==========================================
+ Coverage 77.46% 77.49% +0.02%
==========================================
Files 149 149
Lines 18244 18304 +60
Branches 1785 1787 +2
==========================================
+ Hits 14133 14184 +51
- Misses 4088 4097 +9
Partials 23 23 ☔ View full report in Codecov by Sentry. |
Natoandro
left a comment
There was a problem hiding this comment.
Do you think you can add some tests?
So, I digged a bit and as far as I know, there seems to be no way to retrieve all PIDs or get handles of the child processes that are spawned by child processes in Deno. Spawn, kill with SIGTERM/SIGHUP, spawn again then checking the std output for |
Can't you just check the processes using shell commands? |
There was a problem hiding this comment.
Looks good. So, there's this FIXME case in the tests where the meta dev leaks the typegate process. It doesn't seem to show up on my dev machine anymore but it was a regular on the coder machines. It also regularly leaked on the CI machines and...
...yeah, I just checked by running the CI on this PR and it still leaks it seems. The following screenshot is from this CI run observed through a tmate session.

The two tests that use the meta-full build have already passed by the time I took this screenshot.
Hopefully, this PR improves the state in developer shells but the bug seems still at large.
Edit: replaced screenshot with one that shows currently running test.
That is surprising, the way I tested it was sending the signals directly through |
Ctrlc would be SIGKILL for that matter and that at least should work even without this patch. |
Ctrl C corresponds to SIGTERM actually. SIGKILL is the harsher cousin that immediately kills the process. You're not able to register handlers for it and do clean up. In that FIXME, I'm using SIGTERM to give it a chance to clean up but no bueno. |
My bad, I meant SIGINT. But you are right, SIGTERM is more appropriate. |
53e319a to
edf6191
Compare
2bdbc5a to
75728d5
Compare
Migration notes
None