-
Notifications
You must be signed in to change notification settings - Fork 959
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
Revisit shutdown behavior of the emulators #3578
Comments
I'm eager to see if this would help with a problem I have with npm, In short, This, in turn, leaves ports dangling when the whole Docker process is killed, which is slightly surprising, to say the least. There are multiple places this snowball effect could be avoided. The change in Firebase Emulators is one of them. If this gets to a PR, I'm happy to test that in advance of actual release, to provide feedback whether it helps in my situation. |
I've filed this bug internally (b/194384884) for more investigation/tracking. |
I just changed from concurrently to npm-run-all, and my Ctrl+C double SIGINT is gone; I can now export and import emulator data. |
I tested this and the emulator processes still aren't exiting properly. After Ctrl+C all the emulator ports are still in use. |
Since July (comment above) I’ve gotten the Docker Compose solution to be pretty sweet. Am happy to share it and help if someone wants to take that route. As I wrote:
One of them is by using the emulators via Docker. This allows sandboxing them at large, which I find useful. |
Wanted to ask about possibilities for this too. Forcing clean shutdown would be great, but what can be a back up if that fails or if a process sends a SIGTERM or SIGKILL, potentially with IDE tooling or with other runners? Is there a potential for each of the external processes to at the least run a health check of some sort against the central server program started by emulators:start? (i.e. if the terminal force quit unexpectedly, after a time interval each of the services would perform a health check and automatically shutdown if the central program was not running) I figure something like this may still have data loss from the exports, but at least it would help with cleaning up disconnected processes and freeing up blocked ports which in general is the main pain point for using the emulator and the reason most have had to swap to a container like docker to isolate the environment which adds its own struggles/complications then. |
@MatthewFallon these are great ideas and we're tracking them in an internal bug now. We are unable to promise any timeline for this, but if others also have this request, adding a +1 on this issue can help us prioritize adding this to the roadmap. (Googler-only internal tracking bug: b/217243556) |
+1 |
+1 |
1 similar comment
+1 |
+1 (I run into this when I run firestore)
|
Currently we do this for the emulators:
Ctrl+C (SIGINT)
--> clean shutdownCtrl+C (SIGINT)
separated by a human interval --> immediate shutdownWe should probably never shut down dirty on Ctrl+
SIGINT
, it seems that many tools and terminal emulators passSIGINT
many times which causes a dirty shutdowns. Dirty shutdowns can lead to corrupted exports, blocked ports, etc and other things which are much harder to clean up than a runaway process.We could instead do something like raise a prompt like "You seem to be slamming Ctrl+C friend, would you like to force quit?"
The text was updated successfully, but these errors were encountered: