Skip to content

core: Use SyncContext for InProcessTransport listener callbacks to avoid deadlocks - #9319

Merged
ejona86 merged 1 commit into
grpc:masterfrom
larry-safran:fix-3084
Jun 30, 2022
Merged

core: Use SyncContext for InProcessTransport listener callbacks to avoid deadlocks#9319
ejona86 merged 1 commit into
grpc:masterfrom
larry-safran:fix-3084

Conversation

@larry-safran

@larry-safran larry-safran commented Jun 28, 2022

Copy link
Copy Markdown
Contributor

Fixes deadlocks caused by client and server listeners being called in a synchronized block

Also support unary calls returning null values

Fixes #3084

@larry-safran
larry-safran requested a review from ejona86 June 28, 2022 01:41
Comment thread core/src/main/java/io/grpc/inprocess/InProcessTransport.java Outdated
Comment thread core/src/main/java/io/grpc/inprocess/InProcessTransport.java
Comment thread core/src/main/java/io/grpc/inprocess/InProcessTransport.java Outdated
Comment thread core/src/main/java/io/grpc/inprocess/InProcessTransport.java Outdated
Comment thread core/src/main/java/io/grpc/inprocess/InProcessTransport.java Outdated
Comment thread core/src/main/java/io/grpc/inprocess/InProcessTransport.java Outdated
@ejona86

ejona86 commented Jun 28, 2022

Copy link
Copy Markdown
Member

The "Fixes bug #3084" is normally just included in the commit/PR description, not the title. And we use "Fixes #3084" syntax so github auto-links the PR to the issue. See #9300 for an example.

@larry-safran larry-safran changed the title [core] Use SyncContext for InProcessTransport listener callbacks to avoid deadlocks (Fixes bug #3084) core: Use SyncContext for InProcessTransport listener callbacks to avoid deadlocks (Fixes bug #3084) Jun 28, 2022
@larry-safran larry-safran changed the title core: Use SyncContext for InProcessTransport listener callbacks to avoid deadlocks (Fixes bug #3084) core: Use SyncContext for InProcessTransport listener callbacks to avoid deadlocks Jun 28, 2022
Comment thread core/src/main/java/io/grpc/inprocess/InProcessTransport.java Outdated
Comment thread core/src/main/java/io/grpc/inprocess/InProcessTransport.java Outdated
…void deadlocks

Fixes grpc#3084
Also support unary calls returning null values
@ejona86
ejona86 merged commit 74137b0 into grpc:master Jun 30, 2022
@ejona86 ejona86 added the TODO:backport PR needs to be backported. Removed after backport complete label Jun 30, 2022
@larry-safran
larry-safran deleted the fix-3084 branch July 7, 2022 17:44
@YifeiZhuang

Copy link
Copy Markdown
Member

Hi @larry-safran @ejona86 do we still want to back port this change?

@larry-safran larry-safran removed the TODO:backport PR needs to be backported. Removed after backport complete label Jul 11, 2022
@larry-safran

larry-safran commented Jul 11, 2022 via email

Copy link
Copy Markdown
Contributor Author

copybara-service Bot pushed a commit to bazelbuild/bazel that referenced this pull request Sep 20, 2022
These tests verify corner cases in the bidirectional BES protocol and had
been relying on the in-process gRPC transport with direct execution to
correctly use concurrency primitives. Since the inprocess gRPC transport
was changed in grpc/grpc-java#9319 these tests
are no longer correct and need to be carefully updated to match the new
inprocess gRPC threading model. Updating the tests will take long enough
that temporarily ignoring the tests will meaningfully reduce CI flakes.

PiperOrigin-RevId: 475617300
Change-Id: Ibf27e10b433030ede29fe0587315fbad1a76dbe0
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Potential deadlock due to calling callbacks while holding a lock

3 participants