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
ff17b050
Commit
ff17b050
authored
7 years ago
by
Vijay Pai
Browse files
Options
Downloads
Patches
Plain Diff
Document error unref contract for iomgr cb's and transport/stream errors
parent
c4f85b78
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/core/lib/iomgr/closure.h
+3
-1
3 additions, 1 deletion
src/core/lib/iomgr/closure.h
src/core/lib/transport/transport.c
+5
-0
5 additions, 0 deletions
src/core/lib/transport/transport.c
src/core/lib/transport/transport.h
+8
-2
8 additions, 2 deletions
src/core/lib/transport/transport.h
with
16 additions
and
3 deletions
src/core/lib/iomgr/closure.h
+
3
−
1
View file @
ff17b050
...
@@ -42,7 +42,9 @@ typedef struct grpc_closure_list {
...
@@ -42,7 +42,9 @@ typedef struct grpc_closure_list {
*
*
* \param arg Arbitrary input.
* \param arg Arbitrary input.
* \param error GRPC_ERROR_NONE if no error occurred, otherwise some grpc_error
* \param error GRPC_ERROR_NONE if no error occurred, otherwise some grpc_error
* describing what went wrong */
* describing what went wrong.
* Error contract: it is not the cb's job to unref this error;
* the closure scheduler will do that after the cb returns */
typedef
void
(
*
grpc_iomgr_cb_func
)(
grpc_exec_ctx
*
exec_ctx
,
void
*
arg
,
typedef
void
(
*
grpc_iomgr_cb_func
)(
grpc_exec_ctx
*
exec_ctx
,
void
*
arg
,
grpc_error
*
error
);
grpc_error
*
error
);
...
...
This diff is collapsed.
Click to expand it.
src/core/lib/transport/transport.c
+
5
−
0
View file @
ff17b050
...
@@ -206,6 +206,11 @@ grpc_endpoint *grpc_transport_get_endpoint(grpc_exec_ctx *exec_ctx,
...
@@ -206,6 +206,11 @@ grpc_endpoint *grpc_transport_get_endpoint(grpc_exec_ctx *exec_ctx,
return
transport
->
vtable
->
get_endpoint
(
exec_ctx
,
transport
);
return
transport
->
vtable
->
get_endpoint
(
exec_ctx
,
transport
);
}
}
// grpc_transport_stream_op_batch_finish_with_failure
// is a function that must always unref cancel_error
// though it lives in lib, it handles transport stream ops sure
// it's grpc_transport_stream_op_batch_finish_with_failure
void
grpc_transport_stream_op_batch_finish_with_failure
(
void
grpc_transport_stream_op_batch_finish_with_failure
(
grpc_exec_ctx
*
exec_ctx
,
grpc_transport_stream_op_batch
*
op
,
grpc_exec_ctx
*
exec_ctx
,
grpc_transport_stream_op_batch
*
op
,
grpc_error
*
error
)
{
grpc_error
*
error
)
{
...
...
This diff is collapsed.
Click to expand it.
src/core/lib/transport/transport.h
+
8
−
2
View file @
ff17b050
...
@@ -198,6 +198,8 @@ struct grpc_transport_stream_op_batch_payload {
...
@@ -198,6 +198,8 @@ struct grpc_transport_stream_op_batch_payload {
grpc_chttp2_grpc_status_to_http2_error. Send a RST_STREAM with this
grpc_chttp2_grpc_status_to_http2_error. Send a RST_STREAM with this
error. */
error. */
struct
{
struct
{
// Error contract: the transport that gets this op must cause cancel_error
// to be unref'ed after processing it
grpc_error
*
cancel_error
;
grpc_error
*
cancel_error
;
}
cancel_stream
;
}
cancel_stream
;
...
@@ -212,9 +214,13 @@ typedef struct grpc_transport_op {
...
@@ -212,9 +214,13 @@ typedef struct grpc_transport_op {
/** connectivity monitoring - set connectivity_state to NULL to unsubscribe */
/** connectivity monitoring - set connectivity_state to NULL to unsubscribe */
grpc_closure
*
on_connectivity_state_change
;
grpc_closure
*
on_connectivity_state_change
;
grpc_connectivity_state
*
connectivity_state
;
grpc_connectivity_state
*
connectivity_state
;
/** should the transport be disconnected */
/** should the transport be disconnected
* Error contract: the transport that gets this op must cause
* disconnect_with_error to be unref'ed after processing it */
grpc_error
*
disconnect_with_error
;
grpc_error
*
disconnect_with_error
;
/** what should the goaway contain? */
/** what should the goaway contain?
* Error contract: the transport that gets this op must cause
* goaway_error to be unref'ed after processing it */
grpc_error
*
goaway_error
;
grpc_error
*
goaway_error
;
/** set the callback for accepting new streams;
/** set the callback for accepting new streams;
this is a permanent callback, unlike the other one-shot closures.
this is a permanent callback, unlike the other one-shot closures.
...
...
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