Skip to content

Commit

Permalink
fix: Only check keyHasError if ordering key is non-empty (#367)
Browse files Browse the repository at this point in the history
* feat: Add flow control support to publisher

* make suggested fixes

* chore: Remove note that ordering keys requires enablements.

* feat: Add support for server-side flow control

* Revert "chore: Remove note that ordering keys requires enablements."

This reverts commit 9c113c3.

* fix: Fix import order

* fix: Make error message more clear about where ordering must be enabled when publishing.

* fix: Ensure that messages that are in pending batches for an ordering key are canceled when a previous publish for the ordering keys fails.

* fix: Only check keyHasError if ordering keys is non-empty
  • Loading branch information
kamalaboulhosn committed Sep 29, 2020
1 parent 7cdf8bc commit 8b2d0b7
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -256,7 +256,7 @@ public ApiFuture<String> publish(PubsubMessage message) {
List<OutstandingBatch> batchesToSend;
messagesBatchLock.lock();
try {
if (sequentialExecutor.keyHasError(orderingKey)) {
if (!orderingKey.isEmpty() && sequentialExecutor.keyHasError(orderingKey)) {
outstandingPublish.publishResult.setException(
SequentialExecutorService.CallbackExecutor.CANCELLATION_EXCEPTION);
return outstandingPublish.publishResult;
Expand Down

0 comments on commit 8b2d0b7

Please sign in to comment.