firestore: getPartitions() emits gax AutopaginateTrueWarning in every process
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- backend
Hướng nghiên cứu
Bắt đầu tại handwritten/firestore/dev/src/index.ts và lần theo Firestore.requestStream() đến createCallOptions(), kiểm tra cách các tùy chọn được truyền đến lệnh gọi phân trang stream của gax. Đặt autoPaginate thành false trong các tùy chọn gọi stream. Sau đó, xác minh getPartitions() hoàn tất mà không có cảnh báo và vẫn đọc các phân vùng qua nhiều trang.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Library: @google-cloud/firestore 7.11.3 (through firebase-admin 13.10.0), google-gax 4.6.1, Node.js 24. The same code is on main in handwritten/firestore/dev/src/index.ts.
Reproduction
// npm i @google-cloud/[email protected]
// FIRESTORE_EMULATOR_HOST=127.0.0.1:9 node repro.cjs
const {Firestore} = require('@google-cloud/firestore');
process.on('warning', w => console.log('warning event:', w.name));
const db = new Firestore({projectId: 'demo-repro'});
(async () => {
for await (const _ of db.collectionGroup('any').getPartitions(2)) {}
})().catch(() => {});
No server is necessary: the warning is emitted when the request is built. Output:
(node:1) AutopaginateTrueWarning: Autopaginate will always be set to false in stream paging methods. See more info at https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure paging calls
warning event: AutopaginateTrueWarning
Cause
Firestore.requestStream() uses the call options from createCallOptions(), which do not set autoPaginate. gax's CallSettings sets autoPaginate to true when the option is not given. PageDescriptor.createStream() then warns for partitionQueryStream, a stream paging method, and forces autoPaginate: false. The caller cannot change this, because getPartitions() accepts no call options.
Expected
No warning. The partitions are read correctly; only the warning is wrong.
Why it matters
Node writes the warning to stderr. Cloud Run and Cloud Functions record stderr at severity ERROR, so each process that calls getPartitions() creates an Error Reporting event. googleapis/nodejs-firestore#2335 reported the same class of problem for listDocuments().
Suggested fix
Set autoPaginate: false on the call options in requestStream(). gax already uses that value for every stream paging method, and streams without paging ignore it. We apply this one-line change as a local patch. With the patch, a fake server that returns PartitionQuery results in two pages gives the same partitions and no warning.
- Ngôn ngữ chính
- TypeScript
- Star
- 3.2k
- Fork
- 732
- Merge trung bình
- 3 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 117
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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 googleapis/google-cloud-node
-
Broken deprecation chainĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
googleapis/google-cloud-node#9854 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pubsub: "Operation attempted on ended Span" when a modack is flushed after the message was ackedĐang mởapi: pubsub
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
googleapis/google-cloud-node#9853 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
storage: V4 getSignedUrl sorts canonical headers with localeCompare, so they disagree with X-Goog-SignedHeadersCó thể đã có người làm @itsrayeedscodespace đã nhận 6 ngày trước. Đang mởapi: storage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
googleapis/google-cloud-node#9840 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
googleapis/google-cloud-node#9723 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
spanner: requiring @google-cloud/spanner stops the process from exiting on SIGTERM/SIGINTCó thể làm lại được @alkatrivedi đã nhận 31 ngày trước và không có pull request nào đang mở. Đang mởapi: spanner
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
googleapis/google-cloud-node#9513 · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của googleapis/google-cloud-node
Issue tương tự
-
bug UI
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
wardian-app/Wardian#1746 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: interop area: sip-core v3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
fonoster/routr#705 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Độ 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
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
openclaw/openclaw#198551 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày