This repository was archived by the owner on Mar 4, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 163
This repository was archived by the owner on Mar 4, 2026. It is now read-only.
db.terminate appears to detect BulkWriter leak from recursiveDelete #2273
Copy link
Copy link
Closed
Labels
api: firestoreIssues related to the googleapis/nodejs-firestore API.Issues related to the googleapis/nodejs-firestore API.
Description
Please make sure you have searched for information in the following guides.
- Search the issues already opened: https://github.com/GoogleCloudPlatform/google-cloud-node/issues
- Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js
- Check our Troubleshooting guide: https://github.com/googleapis/google-cloud-node/blob/main/docs/troubleshooting.md
- Check our FAQ: https://github.com/googleapis/google-cloud-node/blob/main/docs/faq.md
- Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md
- Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs
- Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples
A screenshot that you have tested with "Try this API".
Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.
https://github.com/dandv/firestore-recursiveDelete-vs-db.terminate-leaks
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
- Have Deno installed
git clone https://github.com/dandv/firestore-recursiveDelete-vs-db.terminate-leaks.gitcd firestore-recursiveDelete-vs-db.terminate-leaks- Supply the
service-account-key.json - Run
deno test -A recursive-delete.ts
A clear and concise description of what the bug is, and what you expected to happen.
The output shows the following error:
error: "All onSnapshot() listeners must be unsubscribed, and all BulkWriter instances must be closed before terminating the client. There are 0 active listeners and 1 open BulkWriter instances."
A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
https://googleapis.dev/nodejs/firestore/latest/Firestore.html#recursiveDelete mentions "recursiveDelete() uses a BulkWriter instance with default settings to perform the deletes". It doesn't explictly document the bulkWriter parameter as optional, but it is optional, and apparently not closed after the deletion.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: firestoreIssues related to the googleapis/nodejs-firestore API.Issues related to the googleapis/nodejs-firestore API.
