Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
1e5f6af0
Commit
1e5f6af0
authored
Oct 7, 2016
by
Mark D. Roth
Browse files
Options
Downloads
Patches
Plain Diff
Fix grpclb LB policy pick method to return 0 upon error.
parent
e5c744d9
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/core/ext/client_config/lb_policy.h
+12
-9
12 additions, 9 deletions
src/core/ext/client_config/lb_policy.h
src/core/ext/lb_policy/grpclb/grpclb.c
+1
-1
1 addition, 1 deletion
src/core/ext/lb_policy/grpclb/grpclb.c
with
13 additions
and
10 deletions
src/core/ext/client_config/lb_policy.h
+
12
−
9
View file @
1e5f6af0
...
...
@@ -142,15 +142,18 @@ void grpc_lb_policy_weak_unref(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy);
void
grpc_lb_policy_init
(
grpc_lb_policy
*
policy
,
const
grpc_lb_policy_vtable
*
vtable
);
/** Find an appropriate target for this call, based on \a pick_args.
Picking can be synchronous or asynchronous. In the synchronous case, when a
pick is readily available, it'll be returned in \a target and a non-zero
value will be returned.
In the asynchronous case, zero is returned and \a on_complete will be called
once \a target and \a user_data have been set. Any IO should be done under
\a pick_args->pollent. The opaque \a user_data output argument corresponds
to information that may need be propagated from the LB policy. It may be
NULL. Errors are signaled by receiving a NULL \a *target. */
/** Finds an appropriate subchannel for a call, based on \a pick_args.
\a target will be set to the selected subchannel, or NULL on failure.
Upon success, \a user_data will be set to whatever opaque information
may need to be propagated from the LB policy, or NULL if not needed.
If the pick succeeds and a result is known immediately, a non-zero
value will be returned. Otherwise, \a on_complete will be invoked
once the pick is complete with its error argument set to indicate
success or failure.
Any I/O should be done under \a pick_args->pollent. */
int
grpc_lb_policy_pick
(
grpc_exec_ctx
*
exec_ctx
,
grpc_lb_policy
*
policy
,
const
grpc_lb_policy_pick_args
*
pick_args
,
grpc_connected_subchannel
**
target
,
void
**
user_data
,
...
...
This diff is collapsed.
Click to expand it.
src/core/ext/lb_policy/grpclb/grpclb.c
+
1
−
1
View file @
1e5f6af0
...
...
@@ -761,7 +761,7 @@ static int glb_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
GRPC_ERROR_CREATE
(
"No mdelem storage for the LB token. Load reporting "
"won't work without it. Failing"
),
NULL
);
return
1
;
return
0
;
}
glb_lb_policy
*
glb_policy
=
(
glb_lb_policy
*
)
pol
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment