Skip to content

Publisher flow control can block forever if a large message exceeds the bytes limit all by itself #685

@plamut

Description

@plamut

After reviewing the related Ruby PR and comparing it to the similar Python and Java implementations, I think the Java implementation is missing a corner case.

Suppose the publisher flow controller's byteLimit is set to 1000 bytes, and the desired behavior to Block. If a message larger than that arrives (say, 1200 bytes), it would block forever, because it would just reserve the maximum available capacity, but that would still not be enough to let it through. It would also cause all other messages to get stuck behind.

From what I can see, there's no check if a message would actually need to reserve more than byteLimit to get through?

Metadata

Metadata

Labels

api: pubsubIssues related to the googleapis/java-pubsub API.priority: p2Moderately-important priority. Fix may not be included in next release.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