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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
7eaca2f7
Commit
7eaca2f7
authored
7 years ago
by
Noah Eisen
Browse files
Options
Downloads
Patches
Plain Diff
Propagate publish error
parent
d3ba7cbc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/ext/filters/client_channel/subchannel.c
+8
-6
8 additions, 6 deletions
src/core/ext/filters/client_channel/subchannel.c
with
8 additions
and
6 deletions
src/core/ext/filters/client_channel/subchannel.c
+
8
−
6
View file @
7eaca2f7
...
@@ -615,7 +615,7 @@ void grpc_connected_subchannel_ping(grpc_exec_ctx *exec_ctx,
...
@@ -615,7 +615,7 @@ void grpc_connected_subchannel_ping(grpc_exec_ctx *exec_ctx,
elem
->
filter
->
start_transport_op
(
exec_ctx
,
elem
,
op
);
elem
->
filter
->
start_transport_op
(
exec_ctx
,
elem
,
op
);
}
}
static
void
publish_transport_locked
(
grpc_exec_ctx
*
exec_ctx
,
static
bool
publish_transport_locked
(
grpc_exec_ctx
*
exec_ctx
,
grpc_subchannel
*
c
)
{
grpc_subchannel
*
c
)
{
grpc_connected_subchannel
*
con
;
grpc_connected_subchannel
*
con
;
grpc_channel_stack
*
stk
;
grpc_channel_stack
*
stk
;
...
@@ -631,15 +631,16 @@ static void publish_transport_locked(grpc_exec_ctx *exec_ctx,
...
@@ -631,15 +631,16 @@ static void publish_transport_locked(grpc_exec_ctx *exec_ctx,
if
(
!
grpc_channel_init_create_stack
(
exec_ctx
,
builder
,
if
(
!
grpc_channel_init_create_stack
(
exec_ctx
,
builder
,
GRPC_CLIENT_SUBCHANNEL
))
{
GRPC_CLIENT_SUBCHANNEL
))
{
grpc_channel_stack_builder_destroy
(
exec_ctx
,
builder
);
grpc_channel_stack_builder_destroy
(
exec_ctx
,
builder
);
abort
();
/* TODO(ctiller): what to do here (previously we just crashed) */
return
false
;
}
}
grpc_error
*
error
=
grpc_channel_stack_builder_finish
(
grpc_error
*
error
=
grpc_channel_stack_builder_finish
(
exec_ctx
,
builder
,
0
,
1
,
connection_destroy
,
NULL
,
(
void
**
)
&
con
);
exec_ctx
,
builder
,
0
,
1
,
connection_destroy
,
NULL
,
(
void
**
)
&
con
);
if
(
error
!=
GRPC_ERROR_NONE
)
{
if
(
error
!=
GRPC_ERROR_NONE
)
{
grpc_transport_destroy
(
exec_ctx
,
c
->
connecting_result
.
transport
);
gpr_log
(
GPR_ERROR
,
"error initializing subchannel stack: %s"
,
gpr_log
(
GPR_ERROR
,
"error initializing subchannel stack: %s"
,
grpc_error_string
(
error
));
grpc_error_string
(
error
));
GRPC_ERROR_UNREF
(
error
);
GRPC_ERROR_UNREF
(
error
);
abort
();
/* TODO(ctiller): what to do here? */
return
false
;
}
}
stk
=
CHANNEL_STACK_FROM_CONNECTION
(
con
);
stk
=
CHANNEL_STACK_FROM_CONNECTION
(
con
);
memset
(
&
c
->
connecting_result
,
0
,
sizeof
(
c
->
connecting_result
));
memset
(
&
c
->
connecting_result
,
0
,
sizeof
(
c
->
connecting_result
));
...
@@ -656,7 +657,7 @@ static void publish_transport_locked(grpc_exec_ctx *exec_ctx,
...
@@ -656,7 +657,7 @@ static void publish_transport_locked(grpc_exec_ctx *exec_ctx,
grpc_channel_stack_destroy
(
exec_ctx
,
stk
);
grpc_channel_stack_destroy
(
exec_ctx
,
stk
);
gpr_free
(
con
);
gpr_free
(
con
);
GRPC_SUBCHANNEL_WEAK_UNREF
(
exec_ctx
,
c
,
"connecting"
);
GRPC_SUBCHANNEL_WEAK_UNREF
(
exec_ctx
,
c
,
"connecting"
);
return
;
return
false
;
}
}
/* publish */
/* publish */
...
@@ -678,6 +679,7 @@ static void publish_transport_locked(grpc_exec_ctx *exec_ctx,
...
@@ -678,6 +679,7 @@ static void publish_transport_locked(grpc_exec_ctx *exec_ctx,
/* signal completion */
/* signal completion */
grpc_connectivity_state_set
(
exec_ctx
,
&
c
->
state_tracker
,
GRPC_CHANNEL_READY
,
grpc_connectivity_state_set
(
exec_ctx
,
&
c
->
state_tracker
,
GRPC_CHANNEL_READY
,
GRPC_ERROR_NONE
,
"connected"
);
GRPC_ERROR_NONE
,
"connected"
);
return
true
;
}
}
static
void
subchannel_connected
(
grpc_exec_ctx
*
exec_ctx
,
void
*
arg
,
static
void
subchannel_connected
(
grpc_exec_ctx
*
exec_ctx
,
void
*
arg
,
...
@@ -688,8 +690,8 @@ static void subchannel_connected(grpc_exec_ctx *exec_ctx, void *arg,
...
@@ -688,8 +690,8 @@ static void subchannel_connected(grpc_exec_ctx *exec_ctx, void *arg,
GRPC_SUBCHANNEL_WEAK_REF
(
c
,
"connected"
);
GRPC_SUBCHANNEL_WEAK_REF
(
c
,
"connected"
);
gpr_mu_lock
(
&
c
->
mu
);
gpr_mu_lock
(
&
c
->
mu
);
c
->
connecting
=
false
;
c
->
connecting
=
false
;
if
(
c
->
connecting_result
.
transport
!=
NULL
)
{
if
(
c
->
connecting_result
.
transport
!=
NULL
&&
publish_transport_locked
(
exec_ctx
,
c
)
)
{
publish_transport_locked
(
exec_ctx
,
c
);
/* do nothing, transport was published */
}
else
if
(
c
->
disconnected
)
{
}
else
if
(
c
->
disconnected
)
{
GRPC_SUBCHANNEL_WEAK_UNREF
(
exec_ctx
,
c
,
"connecting"
);
GRPC_SUBCHANNEL_WEAK_UNREF
(
exec_ctx
,
c
,
"connecting"
);
}
else
{
}
else
{
...
...
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
register
or
sign in
to comment