Batch commit throw DEADLINE_EXCEEDED but it actually create the documents
Maintainer thường phản hồi trong vòng 1 ngày
@milaGGL đang làm issue này rồi.
Từ ngày 28/5/2025.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Environment
- Operating System version:
Mac M1 arm64 - Firebase SDK version:
13.0.1 - Firebase Product:
firestore - Node.js version:
v20.18.0 - NPM version:
10.9.0
The problem
I've class to handle more then 500 operation by simply creating new batch when reach 500, And when commit I'll run commit on each of the batches, And whenever any commit is failing it go to re-try commit that failed batch.
I had the batch commit fail with error of Deadline exceeded after 60.001s,metadata filters: 0.085s,LB pick: 0.001s,remote_addr=142.250.181.234:443 then after few re-try it was failing for new reason ALREADY_EXISTS: Document already exists and the data was created in the firestore !, If batch commit throw error it shouldn't write in firestore, but it seems commit throw error of the 60s timeout limits but data was actually successfully committed,
full log
commiting batch index 0 , ID: 0_3b6ca345a4a22d6f4d0a2f38eb5507bb
index 0 failed 4 DEADLINE_EXCEEDED: Deadline exceeded after 59.998s,metadata filters: 0.086s,remote_addr=142.250.181.234:443
commiting batch index 1 , ID: 1_a20059deface571877dbc25093dee067
index 1 failed 4 DEADLINE_EXCEEDED: Deadline exceeded after 59.889s,metadata filters: 0.041s,remote_addr=142.250.181.234:443
commiting batch index 2 , ID: 2_de705d40bf041659aa787c5e749ea4d3
index 2 failed 4 DEADLINE_EXCEEDED: Deadline exceeded after 59.999s,metadata filters: 0.025s,remote_addr=142.250.181.234:443
re-commit batchs count 3
total batchs 3 Retry count 2
start commit in sequentially mode
commiting batch index 0 , ID: 0_3b6ca345a4a22d6f4d0a2f38eb5507bb
index 0 failed 4 DEADLINE_EXCEEDED: Deadline exceeded after 59.999s,metadata filters: 0.087s,remote_addr=142.250.181.234:443
commiting batch index 1 , ID: 1_a20059deface571877dbc25093dee067
index 1 failed 4 DEADLINE_EXCEEDED: Deadline exceeded after 60.000s,metadata filters: 0.045s,remote_addr=142.250.181.234:443
commiting batch index 2 , ID: 2_de705d40bf041659aa787c5e749ea4d3
index 2 failed 6 ALREADY_EXISTS: Document already exists: projects/PROJECT_ID/databases/(default)/documents/COLLECTION_NAME/KSYlyNKEwJ4tkKGyZ0WR
re-commit batchs count 3
total batchs 3 Retry count 3
start commit in sequentially mode
commiting batch index 0 , ID: 0_3b6ca345a4a22d6f4d0a2f38eb5507bb
index 0 failed 4 DEADLINE_EXCEEDED: Deadline exceeded after 59.999s,metadata filters: 0.086s,remote_addr=142.250.181.234:443
commiting batch index 1 , ID: 1_a20059deface571877dbc25093dee067
index 1 failed 4 DEADLINE_EXCEEDED: Deadline exceeded after 59.999s,metadata filters: 0.043s,LB pick: 0.001s,remote_addr=142.250.181.234:443
commiting batch index 2 , ID: 2_de705d40bf041659aa787c5e749ea4d3
index 2 failed 6 ALREADY_EXISTS: Document already exists: projects/PROJECT_ID/databases/(default)/documents/COLLECTION_NAME/KSYlyNKEwJ4tkKGyZ0WR
re-commit batchs count 3
total batchs 3 Retry count 4
start commit in sequentially mode
commiting batch index 0 , ID: 0_3b6ca345a4a22d6f4d0a2f38eb5507bb
index 0 failed 4 DEADLINE_EXCEEDED: Deadline exceeded after 59.999s,metadata filters: 0.086s,remote_addr=142.250.181.234:443
commiting batch index 1 , ID: 1_a20059deface571877dbc25093dee067
index 1 failed 6 ALREADY_EXISTS: Document already exists: projects/PROJECT_ID/databases/(default)/documents/COLLECTION_NAME/fMQvNaE8y6m8Gx7hUwdb
commiting batch index 2 , ID: 2_de705d40bf041659aa787c5e749ea4d3
index 2 failed 6 ALREADY_EXISTS: Document already exists: projects/PROJECT_ID/databases/(default)/documents/COLLECTION_NAME/KSYlyNKEwJ4tkKGyZ0WR
Reached max try limit, 4 aborting commits.
Steps to reproduce:
I had bad internet and I was writing the 1300 documents with create operation
Relevant Code:
Code of my class
_createBatch(index) {
const batch = {
id: index + '_' + crypto.randomBytes(16).toString('hex'),
batch: this.firestore.batch(),
}
this.batches.push(batch)
return batch
}
async commit() {
for (let i = 0; i < originalBatchsCount; i++) {
const item = this.batches[i]
if (showBatchCounterLog) {
console.log('commiting batch index', i, ', ID:', item.id)
}
try {
await item.batch.commit()
console.log('index is finished', i, 'ID', item.id)
fulfilledIDs.push(item.id)
} catch (e) {
console.log('index ', i, 'failed', e.message)
}
}
}
- Ngôn ngữ chính
- TypeScript
- Star
- 1.7k
- Fork
- 419
- Merge trung bình
- 4 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 16
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của firebase/firebase-admin-node
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
firebase/firebase-admin-node#3234 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[email protected] stable dependency tree fails npm audit via Storage uuid and Firestore google-gaxCó thể đã có người làm @lahirumaramba đã nhận 18 ngày trước. Đang mở
firebase/firebase-admin-node#3221 · 3 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
api: messaging
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
firebase/firebase-admin-node#3215 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
api: messaging
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
firebase/firebase-admin-node#3214 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Firestore] Re-export functions from '@google-cloud/firestore/pipelines'Có thể làm lại được @jonathanedey đã nhận 88 ngày trước và không có pull request nào đang mở. Đang mởapi: firestore type: feature request
firebase/firebase-admin-node#3183 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của firebase/firebase-admin-node
Issue tương tự
-
module-request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ports get and web print 'Port N already in use, trying next...' for every busy port they skipĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
appandflow/stim#1604 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
lingdojo/kana-dojo#31060 · 1 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
SSH workspace restore rewrites relative symlinks into the deleted sync-back staging directoryĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
paperclipai/paperclip#14173 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày