8000 Max ack extension by davidtorres · Pull Request #1898 · googleapis/google-cloud-java · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@davidtorres
Copy link
@davidtorres davidtorres commented Apr 11, 2017

Inadvertently (and my because my lack of knowledge of github PRs) I reset a change in PR #1869 and that caused it to drop it.

@pongad @garrettjonesgoogle

…on to (googleapis#1645)".

Compression is not fully supported in gRPC, can't have it in the library
yet.

This reverts commit a599972.
…Consumer interface, it really is

no useful to be able to set an exception as ack reply, since the result
is the same as nack, if we ever requ
8000
ire another result then we can just
add one more value to the AckReply enum.

Also adding a fail-safe catch so if the receiver ever throws an
exception we will interpret that as a nack and keep going.
This prevents the library extending messages infinitevely if the user
code has lost track of the ack consumer handle.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 11, 2017
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 4883e6f on davidtorres:max-ack-ext into ** on GoogleCloudPlatform:master**.

return new ModifyAckDeadline(ack, 2); // 2 seconds is the initial mod ack deadline
}
});

This comment was marked as spam.

This comment was marked as spam.

});

int timeIncrement = 4; // Second time increment

This comment was marked as spam.

This comment was marked as spam.


while (fakeExecutor.getClock().millisTime() + (timeIncrement * 1000) < 1000 * 60 * 60) {
fakeExecutor.advanceTime(Duration.standardSeconds(timeIncrement));

This comment was marked as spam.

This comment was marked as spam.

* Adding units to new tests variables
* Making a constant for the first time modify ack deadline extension
@garrettjonesgoogle
Copy link
Member

LGTM after tests pass

@garrettjonesgoogle
Copy link
Member

@davidtorres I have a concern that the new test might be flaky - could you check the Travis failures?

manifest only certain github testing environments.
@davidtorres
Copy link
Author

Yes I'm pushing a change now to address the issue, the tests should/might have been flaky before as well (or the expectations too lax), this is an old bug in the tests because of thread scheduling and the latest changes to the tests just exposed the bug.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 09172a6 on davidtorres:max-ack-ext into ** on GoogleCloudPlatform:master**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 6a21a54 on davidtorres:max-ack-ext into ** on GoogleCloudPlatform:master**.

@davidtorres
Copy link
Author

Tests are now passing PTAL


private Deque<Duration> expectedWorkQueue = new LinkedList<>();

public void setupScheduleExpectation(Duration delay) {

This comment was marked as spam.

// Send messages to be acked
List<String> testAckIdsBatch = ImmutableList.of("A", "B", "C");
testReceiver.setExplicitAck(true);
// A modify ack deadline should be schedule for the next 9s

This comment was marked as spam.

This comment was marked as spam.

pendingCallables.add(callable);
}
work();
synchronized (expectedWorkQueue) {

This comment was marked as spam.

This comment was marked as spam.

}
work();
synchronized (expectedWorkQueue) {
if (!expectedWorkQueue.isEmpty() && expectedWorkQueue.peek().equals(callable.delay)) {

This comment was marked as spam.

This comment was marked as spam.

@pongad
Copy link
Contributor
pongad commented Apr 12, 2017

Aside from @garrettjonesgoogle's comments, I'm good with this. Thank you for the PR!

FakeScheduledExecutor that allow you to set expectations on scheduled
work.
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 204438c on davidtorres:max-ack-ext into ** on GoogleCloudPlatform:master**.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

0