Skip to content

Adding grpc_init/grpc_shutdown to subchannel ctor/dtor to solve bugs related to async destruction of subchannels#26965

Merged
Vignesh2208 merged 2 commits intogrpc:masterfrom
Vignesh2208:fix_async_subchannel_destroy_bug
Aug 11, 2021
Merged

Adding grpc_init/grpc_shutdown to subchannel ctor/dtor to solve bugs related to async destruction of subchannels#26965
Vignesh2208 merged 2 commits intogrpc:masterfrom
Vignesh2208:fix_async_subchannel_destroy_bug

Conversation

@Vignesh2208
Copy link
Copy Markdown
Contributor

@Vignesh2208 Vignesh2208 commented Aug 11, 2021

Adds a grpc_init/grpc_shutdown to subchannel constructor and destructor to prevent grpc from being shutdown before the subchannel is destroyed. Subchannels can persist longer than channels because they maybe reused/shared among multiple channels. As a result the subchannel destruction happens asynchronously to channel destruction. If the last channel destruction triggers a grpc_shutdown before the last subchannel destruction, then there maybe race conditions
triggering segmentation faults. To prevent this issue, we call a grpc_init in the subchannel constructor and a grpc_shutdown in the subchannel destructor.

@yashykt

@Vignesh2208 Vignesh2208 added kind/bug lang/core release notes: no Indicates if PR should not be in release notes labels Aug 11, 2021
@Vignesh2208 Vignesh2208 requested a review from markdroth as a code owner August 11, 2021 00:12
@Vignesh2208 Vignesh2208 enabled auto-merge (squash) August 11, 2021 00:48
@Vignesh2208 Vignesh2208 disabled auto-merge August 11, 2021 00:52
@Vignesh2208 Vignesh2208 enabled auto-merge (squash) August 11, 2021 02:04
@Vignesh2208 Vignesh2208 merged commit a35a9e1 into grpc:master Aug 11, 2021
dennycd pushed a commit to dennycd/grpc that referenced this pull request Aug 11, 2021
…related to async destruction of subchannels (grpc#26965)

* Adding grpc_init/grpc_shutdown to subchannel ctor/dtor to solve bugs related to async destruction of subchannels

* removing blank line
ctiller added a commit that referenced this pull request Aug 12, 2021
…ve bugs related to async destruction of subchannels (#26965)"

This reverts commit a35a9e1.
ctiller added a commit that referenced this pull request Aug 13, 2021
…ve bugs related to async destruction of subchannels (#26965)" (#27004)

This reverts commit a35a9e1.
Vignesh2208 added a commit to Vignesh2208/grpc that referenced this pull request Aug 20, 2021
…related to async destruction of subchannels (grpc#26965)

* Adding grpc_init/grpc_shutdown to subchannel ctor/dtor to solve bugs related to async destruction of subchannels

* removing blank line
Vignesh2208 pushed a commit to Vignesh2208/grpc that referenced this pull request Aug 20, 2021
…ve bugs related to async destruction of subchannels (grpc#26965)" (grpc#27004)

This reverts commit a35a9e1.
Vignesh2208 added a commit that referenced this pull request Aug 30, 2021
…r to solve bugs related to async destruction of subchannels (#26965)" (#27004)"

This reverts commit 5f00f9c.
Vignesh2208 added a commit that referenced this pull request Aug 30, 2021
…r to solve bugs related to async destruction of subchannels (#26965)" (#27004)" (#27191)

This reverts commit 5f00f9c.
jtattermusch added a commit that referenced this pull request Sep 3, 2021
…ctor/dtor to solve bugs related to async destruction of subchannels (#26965)" (#27004)" (#27191)"

This reverts commit b016729.
lidizheng pushed a commit to lidizheng/grpc that referenced this pull request Sep 23, 2021
…related to async destruction of subchannels (grpc#26965)

* Adding grpc_init/grpc_shutdown to subchannel ctor/dtor to solve bugs related to async destruction of subchannels

* removing blank line
lidizheng pushed a commit to lidizheng/grpc that referenced this pull request Sep 23, 2021
…ve bugs related to async destruction of subchannels (grpc#26965)" (grpc#27004)

This reverts commit a35a9e1.
lidizheng pushed a commit to lidizheng/grpc that referenced this pull request Sep 23, 2021
…r to solve bugs related to async destruction of subchannels (grpc#26965)" (grpc#27004)" (grpc#27191)

This reverts commit 5f00f9c.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug lang/core release notes: no Indicates if PR should not be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants