Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Revert "[chttp2] fix stream leak with queued flow control update and absence of writes (#30907)" (#30991)" #30992

Merged
merged 2 commits into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 36 additions & 0 deletions CMakeLists.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions build_autogenerated.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2314,7 +2314,7 @@ void grpc_chttp2_act_on_flowctl_action(
grpc_chttp2_transport* t, grpc_chttp2_stream* s) {
WithUrgency(t, action.send_stream_update(),
GRPC_CHTTP2_INITIATE_WRITE_STREAM_FLOW_CONTROL, [t, s]() {
if (s->id != 0) {
if (s->id != 0 && !s->read_closed) {
grpc_chttp2_mark_stream_writable(t, s);
}
});
Expand Down
7 changes: 6 additions & 1 deletion src/core/lib/iomgr/iomgr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ static size_t count_objects(void) {
return n;
}

size_t grpc_iomgr_count_objects_for_testing(void) { return count_objects(); }
size_t grpc_iomgr_count_objects_for_testing(void) {
gpr_mu_lock(&g_mu);
size_t ret = count_objects();
gpr_mu_unlock(&g_mu);
return ret;
}

static void dump_objects(const char* kind) {
grpc_iomgr_object* obj;
Expand Down
14 changes: 14 additions & 0 deletions test/core/transport/chttp2/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -313,3 +313,17 @@ grpc_cc_test(
"//test/core/util:grpc_test_util",
],
)

grpc_cc_test(
name = "stream_leak_with_queued_flow_control_update_test",
srcs = ["stream_leak_with_queued_flow_control_update_test.cc"],
external_deps = [
"gtest",
],
language = "C++",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:grpc_test_util",
],
)