You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue involves workflow/configuration, not code.
[REQUIRED] Steps to reproduce
Download the Firebase Tools.
Open a macOS terminal. Navigate to a folder in which you want to configure Firebase.
Run firebase init to initialize Firebase for the folder. Make sure to configure Firestore and Realtime Database.
In the terminal, start both the firestore emulator and database emulator. firebase emulators:start --only firestore,database should be sufficient.
Open Activity Monitor (or Task Manager in Windows): note that 2 'java' processes are running. Note the PIDs.
Close the terminal via the X button.
Go back to Activity Monitor. Notice that one PID eventually ends, but the other doesn't.
Open a new terminal, as in step 3. Run firebase emulators:start --only firestore,database again.
You should see the error 'Could not start Firestore Emulator, port taken.'
[REQUIRED] Expected behavior
All supporting java services should be closed when the terminal closes.
[REQUIRED] Actual behavior
The Firestore java service does not close properly.
A few things I noticed:
These java processes only appear for Firestore and Realtime Database. This issue does not reproduce when other products are emulated (such as Functions).
This issue only reproduces when Firestore and Realtime Database run together. When Firestore or Database emulators run separately, the java process closes correctly. (This leads me to guess that this is a bug.)
Closing supporting java processes when VSCode closes was originally misunderstood to be a missing feature in firebase-tools, and was filed as case 10184797. (Just for reference)
This problem was originally noticed when running the emulators in a VSCode terminal, but this issue also reproduces using a plain macOS terminal, so to provide a minimally reproducible example, just the plain terminal was used. Usually, I use the VSCode terminal to run the Firebase emulators. Having to remember to close the emulators separately via ALT+C before closing VSCode generally is inconvenient and easily forgotten. (It is also easily forgotten when running the emulators through a normal terminal.) It is also apparently unnecessary when running firestore or database alone. Note that VSCode has no way to automate running a script when closing a process due to their lack of event when closing VSCode, so we can't work around the issue by extending VSCode, to my knowledge.
jzabinski-dolios
changed the title
Java services for firestore not shut down properly when running in VSCode Terminals with database
Java services for firestore not shut down properly when running with database
Jun 16, 2022
Everytime I start or exec emulators, a java window opens:
Aug 08, 2022 10:32:31 PM com.google.cloud.datastore.emulator.firestore.websocket.WebSocketServer start
INFO: Started WebSocket server on ws://localhost:65343
API endpoint: http://localhost:8081
If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:
export FIRESTORE_EMULATOR_HOST=localhost:8081
Dev App Server is now running.
It does not close automatically.
This started happening when I updated firebase-tools and java version
[REQUIRED] Environment info
Firebase 10.8.0
firebase-tools:
10.8.0
Platform:
macOS 11.6.6, VSCode 1.68.0
[REQUIRED] Test case
This issue involves workflow/configuration, not code.
[REQUIRED] Steps to reproduce
firebase init
to initialize Firebase for the folder. Make sure to configure Firestore and Realtime Database.firebase emulators:start --only firestore,database
should be sufficient.firebase emulators:start --only firestore,database
again.You should see the error 'Could not start Firestore Emulator, port taken.'
[REQUIRED] Expected behavior
All supporting java services should be closed when the terminal closes.
[REQUIRED] Actual behavior
The Firestore java service does not close properly.
A few things I noticed:
Closing supporting java processes when VSCode closes was originally misunderstood to be a missing feature in firebase-tools, and was filed as case 10184797. (Just for reference)
This problem was originally noticed when running the emulators in a VSCode terminal, but this issue also reproduces using a plain macOS terminal, so to provide a minimally reproducible example, just the plain terminal was used. Usually, I use the VSCode terminal to run the Firebase emulators. Having to remember to close the emulators separately via ALT+C before closing VSCode generally is inconvenient and easily forgotten. (It is also easily forgotten when running the emulators through a normal terminal.) It is also apparently unnecessary when running firestore or database alone. Note that VSCode has no way to automate running a script when closing a process due to their lack of event when closing VSCode, so we can't work around the issue by extending VSCode, to my knowledge.
FirebaseLog.txt
firebaseJSON.txt
The text was updated successfully, but these errors were encountered: