New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MemoryInstance now revalidates action on requeueing #190

Merged
merged 4 commits into from Oct 11, 2018

Conversation

Projects
None yet
3 participants
@th0br0
Contributor

th0br0 commented Oct 11, 2018

An instance should revalidate the action before requeueing if it did not receive a poll from the worker within the operation_poll_timeout.

This PR adds this functionality together with tests.

@googlebot

This comment has been minimized.

googlebot commented Oct 11, 2018

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@googlebot googlebot added the cla: no label Oct 11, 2018

@th0br0

This comment has been minimized.

Contributor

th0br0 commented Oct 11, 2018

I signed it!

@googlebot

This comment has been minimized.

googlebot commented Oct 11, 2018

CLAs look good, thanks!

@googlebot googlebot added cla: yes and removed cla: no labels Oct 11, 2018

@werkt

Hopefully just a couple of things to fix up here


try {
instance.requeueOperation(queuedOperation);
} catch (IllegalStateException e) {

This comment has been minimized.

@werkt

werkt Oct 11, 2018

Collaborator

this really isn't necessary, the method throwing is a substantial enough indicator that the test failed. Also, I'd much rather have the trace than a helpful message

protected void errorOperation(String name, com.google.rpc.Status status) throws InterruptedException {
Operation operation = getOperation(name);
if (operation == null) {
// throw new IllegalStateException("Trying to error nonexistent operation [" + name + "]");

This comment has been minimized.

@werkt

werkt Oct 11, 2018

Collaborator

Why the commented out code here?

import java.util.HashMap;
import java.util.List;
import java.util.Map;

This comment has been minimized.

@werkt

werkt Oct 11, 2018

Collaborator

Was this an auto formatting thing? Current style throughout the code is no empty lines during diff, and sort alpha.

@@ -83,6 +82,7 @@ public void setUp() throws Exception {
.hashKeys()
.hashSetValues(/* expectedValuesPerKey=*/ 1)
.build());
watchersThreadPool =newFixedThreadPool(1);

This comment has been minimized.

@werkt

werkt Oct 11, 2018

Collaborator

nit: space after =

@th0br0 th0br0 force-pushed the th0br0:requeue-validate branch from 95fb58d to 0f2739b Oct 11, 2018

@th0br0 th0br0 force-pushed the th0br0:requeue-validate branch from 0f2739b to 3fa5f99 Oct 11, 2018

th0br0 and others added some commits Oct 11, 2018

@googlebot

This comment has been minimized.

googlebot commented Oct 11, 2018

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

@googlebot googlebot added cla: no and removed cla: yes labels Oct 11, 2018

@werkt

Fixed the only nit myself. Thanks!

@@ -331,7 +332,7 @@ protected void validateAction(Action action) {
Duration maximum = config.getMaximumActionTimeout();
Preconditions.checkState(
timeout.getSeconds() < maximum.getSeconds() ||
(timeout.getSeconds() == maximum.getSeconds() && timeout.getNanos() < maximum.getNanos()));
(timeout.getSeconds() == maximum.getSeconds() && timeout.getNanos() < maximum.getNanos()));

This comment has been minimized.

@werkt

werkt Oct 11, 2018

Collaborator

I'm surprised that this got indented. regardless, it isn't correct style as it was before. nothing to do here

@@ -59,6 +59,7 @@
import io.grpc.Channel;
import io.grpc.netty.NegotiationType;
import io.grpc.netty.NettyChannelBuilder;

This comment has been minimized.

@werkt

werkt Oct 11, 2018

Collaborator

nit: spacing line

@werkt

werkt approved these changes Oct 11, 2018

@werkt werkt merged commit 7f8f4c4 into bazelbuild:master Oct 11, 2018

1 of 3 checks passed

cla/google CLAs are signed, but unable to verify author consent
Verify Pull Request Waiting for a project member to verify this pull request.
Details
buildkite/buildfarm-male-farmer Build #181 passed and blocked (7 seconds)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment