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
1cbf5761
Commit
1cbf5761
authored
8 years ago
by
Craig Tiller
Browse files
Options
Downloads
Patches
Plain Diff
Fix hanging call bug
parent
470f15b3
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/lib/surface/call.c
+17
-15
17 additions, 15 deletions
src/core/lib/surface/call.c
with
17 additions
and
15 deletions
src/core/lib/surface/call.c
+
17
−
15
View file @
1cbf5761
...
...
@@ -142,22 +142,23 @@ struct grpc_call {
gpr_mu
mu
;
/* client or server call */
uint8_t
is_client
;
bool
is_client
;
/* is the alarm set */
uint8_t
have_alarm
;
bool
have_alarm
;
/** has grpc_call_destroy been called */
uint8_t
destroy_called
;
bool
destroy_called
;
/** flag indicating that cancellation is inherited */
uint8_t
cancellation_is_inherited
;
bool
cancellation_is_inherited
;
/** bitmask of live batches */
uint8_t
used_batches
;
/** which ops are in-flight */
uint8_t
sent_initial_metadata
;
uint8_t
sending_message
;
uint8_t
sent_final_op
;
uint8_t
received_initial_metadata
;
uint8_t
receiving_message
;
uint8_t
received_final_op
;
bool
sent_initial_metadata
;
bool
sending_message
;
bool
sent_final_op
;
bool
received_initial_metadata
;
bool
receiving_message
;
bool
requested_final_op
;
bool
received_final_op
;
/* have we received initial metadata */
bool
has_initial_md_been_received
;
...
...
@@ -1135,6 +1136,7 @@ static void finish_batch(grpc_exec_ctx *exec_ctx, void *bctlp, bool success) {
&
call
->
metadata_batch
[
1
/* is_receiving */
][
1
/* is_trailing */
];
grpc_metadata_batch_filter
(
md
,
recv_trailing_filter
,
call
);
call
->
received_final_op
=
true
;
if
(
call
->
have_alarm
)
{
grpc_timer_cancel
(
exec_ctx
,
&
call
->
alarm
);
}
...
...
@@ -1379,11 +1381,11 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx,
error
=
GRPC_CALL_ERROR_NOT_ON_SERVER
;
goto
done_with_error
;
}
if
(
call
->
re
ceiv
ed_final_op
)
{
if
(
call
->
re
quest
ed_final_op
)
{
error
=
GRPC_CALL_ERROR_TOO_MANY_OPERATIONS
;
goto
done_with_error
;
}
call
->
re
ceiv
ed_final_op
=
1
;
call
->
re
quest
ed_final_op
=
1
;
call
->
buffered_metadata
[
1
]
=
op
->
data
.
recv_status_on_client
.
trailing_metadata
;
call
->
final_op
.
client
.
status
=
op
->
data
.
recv_status_on_client
.
status
;
...
...
@@ -1406,11 +1408,11 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx,
error
=
GRPC_CALL_ERROR_NOT_ON_CLIENT
;
goto
done_with_error
;
}
if
(
call
->
re
ceiv
ed_final_op
)
{
if
(
call
->
re
quest
ed_final_op
)
{
error
=
GRPC_CALL_ERROR_TOO_MANY_OPERATIONS
;
goto
done_with_error
;
}
call
->
re
ceiv
ed_final_op
=
1
;
call
->
re
quest
ed_final_op
=
1
;
call
->
final_op
.
server
.
cancelled
=
op
->
data
.
recv_close_on_server
.
cancelled
;
bctl
->
recv_final_op
=
1
;
...
...
@@ -1459,7 +1461,7 @@ done_with_error:
call
->
receiving_message
=
0
;
}
if
(
bctl
->
recv_final_op
)
{
call
->
re
ceiv
ed_final_op
=
0
;
call
->
re
quest
ed_final_op
=
0
;
}
gpr_mu_unlock
(
&
call
->
mu
);
goto
done
;
...
...
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