Publisher flow control can block forever if a large message exceeds the bytes limit all by itself #685
Labels
api: pubsub
Issues related to the googleapis/java-pubsub API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
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 toBlock
. 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?The text was updated successfully, but these errors were encountered: