-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Killing the shim process does not kill the child process #3294
Comments
I believe this is the same bug as exposed in this issue: #1896 |
Also probably related: #2339 |
To deal with these problems I made my own shim. Maybe you could try it out, and if it works in your case as well, we could move to see if the official shim could be replaced by my implementation? |
Nice! Unfortunately I do not have Visual Studio, I'll try to compile it with gcc and test... |
Ah, that's too bad. I'm not sure |
I managed to compile it with MingW/gcc, it was just missing #define ERROR_ELEVATION_REQUIRED. |
Ah, I'll try to fix this asap then, and will let you know when updates are available. Update: Did some debugging and my arguments / standard input are passed without a problem. I did find a bug, but it was unrelated. |
When I use your shim.exe and start mongod with "--port 12345" for example, any arguments such as --port are ignored and it listens on port 27017 (the default). Tried with Windows 10 64 bits. |
I tried executing |
I tried again (took your shim.exe from the release and ran repshims.bat) and this time the arguments passing works. I must have done something wrong... If you want to test by yourself:
This results in :
If you manage to make the test pass with your shim then I say we have a good candidate to replace the native shim :) |
@ogerardin Alright, the last commit should make this work! I now create a job object which instructs Windows to kill our child when the parent dies, so I don't even have to manage this manually. |
Killing the parent manually now does effectively kill the child ! BTW I compiled it with gcc and the exe is only 47K. |
I created a pull request in your repo for gcc: 71/scoop-better-shimexe#1 |
This issue should be fixed in #3998, which was merged into master. To use, type:
or
Eventually, one of those shims (probably kiennq) will be made the default. If this issue is still a problem after trying both solutions above, please reopen this issue. Thanks! |
This issue originates from a problem with dbtest from project mgo (Mongo driver for Go): globalsign/mgo#328. I believe this issue is a generic issue with scoop, which is exemplified with mongod+dbtest.
Observed behaviour
When mongod is installed using scoop, a shallow executable called a "shim" is created in the path (usually in %USERPROFILE%\scoop\shims). The actual mongod.exe lies somewhere else (normally %USERPROFILE%\scoop\apps\mongodb\current).
When you launch mongod from the command line, the shim launches the actual mongod as a child process. The same happens when dbtest launches mongod, but when it tries to stop the server only the shim gets terminated, the actual server process stays alive and is adopted by userinit.
Expected behaviour
Killing the shim should kill the spawned process.
The text was updated successfully, but these errors were encountered: