Importing data via emulator UI causes massive memory usage
See original GitHub issue[REQUIRED] Environment info
firebase-tools: 8.4.0
Platform: Arch Linux
[REQUIRED] Test case
Export a modest dataset from an existing project. Im my case RTDB json export is 7.5 MB, and my functions count is about 95, with approximately 75% of those are triggers of some sort.
[REQUIRED] Steps to reproduce
Initialize the emulator for RTDB and functions, then start emulator. Import a 7.5mb json file into RTDB. Memory starts increasing at a rate of about 1gb per second, until my OOM manager starts killing processes. My project has about 95 functions, and 75% of those are database triggers. My assumption is that a lot of triggers are firing simultaneously.
[REQUIRED] Expected behavior
This may be a bug, but a feature would be a bootstrap mode that lets me import data without any database triggers firing.
[REQUIRED] Actual behavior
The emulator itself continues to run, by my OOM manager starts killing processes to try to accomodate the memory usage, until pretty much all processes have been killed. The app itself never throws any errors.
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (6 by maintainers)
@fpeterdev yes it’s not documented yet (on my to-do list!) but there is a function in
@firebase/rules-unit-testing
calledwithFunctionTriggersDisabled()
that lets you do this.Example:
Thank you! Will such an option be available from the UI during import? We are using the emulator for development as well, and it would be great if we could reload the initial data to the database without restarting the emulator. By the way, this feature would make sense on the “real” firebase console as well. (e.g. for restoring a previous backup)