Skip to content

Commit 5a81613

Browse files
committed
Adding comments
1 parent 6073e7e commit 5a81613

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ private Publisher(Builder builder) throws IOException {
142142
retrySettingsBuilder.setMaxAttempts(Integer.MAX_VALUE);
143143
}
144144
if (enableMessageOrdering) {
145+
// TODO: is there a way to have the default retry settings for requests without an ordering key?
145146
retrySettingsBuilder
146147
.setMaxAttempts(Integer.MAX_VALUE)
147148
.setTotalTimeout(Duration.ofNanos(Long.MAX_VALUE));

google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SequentialExecutorService.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ public void onSuccess(T msg) {
223223
// Step 5.2: on failure
224224
@Override
225225
public void onFailure(Throwable e) {
226-
keysWithErrors.add(key);
227226
future.setException(e);
228227
cancelQueuedTasks(key, CANCELLATION_EXCEPTION);
229228
}
@@ -250,8 +249,7 @@ void resumePublish(String key) {
250249

251250
/** Cancels every task in the queue associated with {@code key}. */
252251
private void cancelQueuedTasks(final String key, Throwable e) {
253-
// TODO(kimkyung-goog): Ensure execute() fails once cancelQueueTasks() has been ever invoked,
254-
// so that no more tasks are scheduled.
252+
keysWithErrors.add(key);
255253
synchronized (tasksByKey) {
256254
final Queue<CancellableRunnable> tasks = tasksByKey.get(key);
257255
if (tasks != null) {

0 commit comments

Comments
 (0)