googleapis / googleapis/google-cloud-node

BulkWriter: DEADLINE_EXCEEDED error when deleting documents in single collection

Open
#7,431 1 comment 0 reactions 0 assignees View on GitHub
api: firestore library: nodejs-firestore priority: p2 type: bug
Dominant language
TypeScript
Stars
3.2k
Forks
712
Avg merge
2d 3h
Merged PRs (30d)
99

Description

When using `BulkWriter` to delete 5,000 documents simultaneously from a single collection, I’m getting the following error:
````
4 DEADLINE_EXCEEDED: Deadline exceeded after 72.021s,metadata filters: 0.001s,remote_addr=173.194.64.95:443
````

Despite the BulkWriter returning the deadline exceeded error, all the documents are eventually deleted.

Additionally, I’ve noticed that the default [error handler function](https://github.com/googleapis/nodejs-firestore/blob/main/dev/src/bulk-writer.ts#L504) in BulkWriter doesn’t retry the DEADLINE_EXCEEDED error ([config](https://github.com/googleapis/nodejs-firestore/blob/main/dev/src/v1/firestore_client_config.json#L110)). However, this error can be retried for single deletion operations [according to the configuration](https://github.com/googleapis/nodejs-firestore/blob/main/dev/src/v1/firestore_client_config.json#L55C32-L55C89).

#### Environment details

- Node.js version: 22.13.0
- npm version: 10.9.2
- `@google-cloud/firestore` version: 7.11.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.