Skip to content
Snippets Groups Projects
Commit 5cf3c372 authored by David Garcia Quintas's avatar David Garcia Quintas
Browse files

Back to using inf future lor LB call deadline

parent 6909922f
No related branches found
No related tags found
No related merge requests found
...@@ -602,9 +602,11 @@ static bool pick_subchannel(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, ...@@ -602,9 +602,11 @@ static bool pick_subchannel(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
int r; int r;
GRPC_LB_POLICY_REF(lb_policy, "pick_subchannel"); GRPC_LB_POLICY_REF(lb_policy, "pick_subchannel");
gpr_mu_unlock(&chand->mu); gpr_mu_unlock(&chand->mu);
// TODO(dgq): use deadline for service config instead of inf_future for the
// pick's deadline.
const grpc_lb_policy_pick_args inputs = { const grpc_lb_policy_pick_args inputs = {
calld->pollent, initial_metadata, initial_metadata_flags, calld->pollent, initial_metadata, initial_metadata_flags,
&calld->lb_token_mdelem, calld->deadline}; &calld->lb_token_mdelem, gpr_inf_future(GPR_CLOCK_MONOTONIC)};
r = grpc_lb_policy_pick(exec_ctx, lb_policy, &inputs, connected_subchannel, r = grpc_lb_policy_pick(exec_ctx, lb_policy, &inputs, connected_subchannel,
NULL, on_ready); NULL, on_ready);
GRPC_LB_POLICY_UNREF(exec_ctx, lb_policy, "pick_subchannel"); GRPC_LB_POLICY_UNREF(exec_ctx, lb_policy, "pick_subchannel");
......
...@@ -65,7 +65,7 @@ typedef struct grpc_lb_policy_pick_args { ...@@ -65,7 +65,7 @@ typedef struct grpc_lb_policy_pick_args {
uint32_t initial_metadata_flags; uint32_t initial_metadata_flags;
/** Storage for LB token in \a initial_metadata, or NULL if not used */ /** Storage for LB token in \a initial_metadata, or NULL if not used */
grpc_linked_mdelem *lb_token_mdelem_storage; grpc_linked_mdelem *lb_token_mdelem_storage;
/** Deadline associated with the picking call. */ /** Deadline for the call to the LB server */
gpr_timespec deadline; gpr_timespec deadline;
} grpc_lb_policy_pick_args; } grpc_lb_policy_pick_args;
......
...@@ -275,7 +275,7 @@ typedef struct glb_lb_policy { ...@@ -275,7 +275,7 @@ typedef struct glb_lb_policy {
const char *server_name; const char *server_name;
grpc_client_channel_factory *cc_factory; grpc_client_channel_factory *cc_factory;
/** deadline for the original client's call */ /** deadline for the LB's call */
gpr_timespec deadline; gpr_timespec deadline;
/** for communicating with the LB server */ /** for communicating with the LB server */
...@@ -766,10 +766,7 @@ static int glb_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, ...@@ -766,10 +766,7 @@ static int glb_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
glb_lb_policy *glb_policy = (glb_lb_policy *)pol; glb_lb_policy *glb_policy = (glb_lb_policy *)pol;
gpr_mu_lock(&glb_policy->mu); gpr_mu_lock(&glb_policy->mu);
/* use the longest deadline across incoming calls for the communication with glb_policy->deadline = pick_args->deadline;
* the LB server */
glb_policy->deadline =
gpr_time_max(pick_args->deadline, glb_policy->deadline);
bool pick_done; bool pick_done;
if (glb_policy->rr_policy != NULL) { if (glb_policy->rr_policy != NULL) {
...@@ -930,7 +927,6 @@ static lb_client_data *lb_client_data_create(glb_lb_policy *glb_policy) { ...@@ -930,7 +927,6 @@ static lb_client_data *lb_client_data_create(glb_lb_policy *glb_policy) {
grpc_closure_init(&lb_client->close_sent, close_sent_cb, lb_client); grpc_closure_init(&lb_client->close_sent, close_sent_cb, lb_client);
grpc_closure_init(&lb_client->srv_status_rcvd, srv_status_rcvd_cb, lb_client); grpc_closure_init(&lb_client->srv_status_rcvd, srv_status_rcvd_cb, lb_client);
/* the longest deadline across incoming calls */
lb_client->deadline = glb_policy->deadline; lb_client->deadline = glb_policy->deadline;
/* Note the following LB call progresses every time there's activity in \a /* Note the following LB call progresses every time there's activity in \a
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment