Skip to content

firestore: infinite iteration. iterator never stops on service unavailble error. #13359

@nikolaydubina

Description

@nikolaydubina

Client

firestore

Environment

Alpine Docker on GKE

$ go version
go version go1.25.0 darwin/arm64

Code and Dependencies

it never done here.

doc, err := iter.Next()
if err != nil {
	if errors.Is(err, iterator.Done) {
		return
	}
// returns here error. which is not DONE! "rpc error: code = Unavailable desc = Query timed out. Please try either limiting the entities scanned, or run with an updated index configuration."

Expected behavior

iterator should be Done or stop eventually. it never stops now. error from it is never Done.

Actual behavior

infinite iteration. this is crazy.

Screenshots

this is crazy.

this costed us 100 USD / day to observe these infinite logs generated from iterator. this is 10x than our entire GKE K8S cluster! and thankfully we noticed and shut down and deleted whole logs. but we are small scale, imaging large scale customer sees this? the behavior of this API is insane. if you really want people to use your service you should stop this.

Image

Additional context

we keep having these issues with firestore iterators never terminate #12694. we reported this before to google, but no avail. please finally terminate them if they are broken!

and last time we reported this we were assured that iterator will stop. but it DIDN'T!

Subsequent calls to Next() will just return the cached error, and there are no infinite calls to the service.

Metadata

Metadata

Assignees

Labels

api: firestoreIssues related to the Firestore API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions