Skip to content
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

db.terminate appears to detect BulkWriter leak from recursiveDelete #2273

Closed
7 tasks done
dandv opened this issue Jan 5, 2025 · 2 comments · Fixed by #2276
Closed
7 tasks done

db.terminate appears to detect BulkWriter leak from recursiveDelete #2273

dandv opened this issue Jan 5, 2025 · 2 comments · Fixed by #2276
Assignees
Labels
api: firestore Issues related to the googleapis/nodejs-firestore API.

Comments

@dandv
Copy link

dandv commented Jan 5, 2025

Please make sure you have searched for information in the following guides.

A screenshot that you have tested with "Try this API".

image

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.

  1. Have Deno installed
  2. git clone https://github.com/dandv/firestore-recursiveDelete-vs-db.terminate-leaks.git
  3. cd firestore-recursiveDelete-vs-db.terminate-leaks
  4. Supply the service-account-key.json
  5. 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.

@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/nodejs-firestore API. label Jan 5, 2025
@tom-andersen
Copy link
Contributor

Thank you for the repro! 😄 Let me get back to you once I run your code.

@tom-andersen
Copy link
Contributor

A fix will be in next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/nodejs-firestore API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants