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

[call-v3] Direct channel implementation #36734

Closed
wants to merge 786 commits into from
Closed
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
786 commits
Select commit Hold shift + click to select a range
2f2b456
Merge branch 'transport-refs-7.8' into transport-refs-7.8.1
ctiller May 29, 2024
23faae0
fix
ctiller May 29, 2024
4334a2b
Merge branch 'transport-refs-7.8.1' into transport-refs-7.8.2
ctiller May 29, 2024
c5d3761
Merge branch 'transport-refs-7.8.2' into transport-refs-7.8.3
ctiller May 29, 2024
689b9f6
Merge branch 'transport-refs-7.8.3' into transport-refs-7.8.4
ctiller May 29, 2024
a82b7e0
Merge branch 'transport-refs-7.8.4' into transport-refs-7.8.5
ctiller May 29, 2024
150f3c2
Merge branch 'transport-refs-7.8.5' into transport-refs-7.8.6
ctiller May 29, 2024
5d5f6a4
Merge branch 'transport-refs-7.8.6' into transport-refs-7.8.7
ctiller May 29, 2024
a4adb84
Merge branch 'transport-refs-7.8.7' into transport-refs-7.8.8
ctiller May 29, 2024
22dbf99
Merge branch 'transport-refs-7.8.8' into transport-refs-7.8.9
ctiller May 29, 2024
ace6010
Merge branch 'transport-refs-7.8.9' into transport-refs-7.8.10
ctiller May 29, 2024
72963af
Merge branch 'transport-refs-7.8.10' into transport-refs-8
ctiller May 29, 2024
7d91de7
x
ctiller May 29, 2024
64eddc2
Merge branch 'transport-refs-7' into transport-refs-7.5
ctiller May 29, 2024
b044efd
Merge branch 'transport-refs-7.5' into transport-refs-7.7
ctiller May 29, 2024
9856f72
Merge branch 'transport-refs-7.7' into transport-refs-7.8
ctiller May 29, 2024
7c01d76
Merge branch 'transport-refs-7.8' into transport-refs-7.8.1
ctiller May 29, 2024
e96a73a
Merge branch 'transport-refs-7.8.1' into transport-refs-7.8.2
ctiller May 29, 2024
d8939c3
Merge branch 'transport-refs-7.8.2' into transport-refs-7.8.3
ctiller May 29, 2024
2f02a34
Merge branch 'transport-refs-7.8.3' into transport-refs-7.8.4
ctiller May 29, 2024
2490296
Merge branch 'transport-refs-7.8.4' into transport-refs-7.8.5
ctiller May 29, 2024
9ec9998
Merge branch 'transport-refs-7.8.5' into transport-refs-7.8.6
ctiller May 29, 2024
bac5fa1
Merge branch 'transport-refs-7.8.6' into transport-refs-7.8.7
ctiller May 29, 2024
630ef9f
Merge branch 'transport-refs-7.8.7' into transport-refs-7.8.8
ctiller May 29, 2024
ff56117
Merge branch 'transport-refs-7.8.8' into transport-refs-7.8.9
ctiller May 29, 2024
e9cc4b0
Merge branch 'transport-refs-7.8.9' into transport-refs-7.8.10
ctiller May 29, 2024
1ca6841
Merge branch 'transport-refs-7.8.10' into transport-refs-8
ctiller May 29, 2024
217c036
x
ctiller May 29, 2024
0082ddc
fix
ctiller May 29, 2024
00ae392
Merge branch 'master' into transport-refs-7
ctiller May 29, 2024
f073731
Merge branch 'transport-refs-7' into transport-refs-7.5
ctiller May 29, 2024
41392ae
Merge branch 'transport-refs-7.5' into transport-refs-7.7
ctiller May 29, 2024
2c54de6
Merge branch 'transport-refs-7.7' into transport-refs-7.8
ctiller May 29, 2024
c5606a8
Merge branch 'transport-refs-7.8' into transport-refs-7.8.1
ctiller May 29, 2024
9fec237
Merge branch 'transport-refs-7.8.1' into transport-refs-7.8.2
ctiller May 29, 2024
c7b8ef8
Merge branch 'transport-refs-7.8.2' into transport-refs-7.8.3
ctiller May 29, 2024
4364461
Merge branch 'transport-refs-7.8.3' into transport-refs-7.8.4
ctiller May 29, 2024
f597cbf
Merge branch 'transport-refs-7.8.4' into transport-refs-7.8.5
ctiller May 29, 2024
2c55a25
Merge branch 'transport-refs-7.8.5' into transport-refs-7.8.6
ctiller May 29, 2024
0f88f52
Merge branch 'transport-refs-7.8.6' into transport-refs-7.8.7
ctiller May 29, 2024
a1ca408
Merge branch 'transport-refs-7.8.7' into transport-refs-7.8.8
ctiller May 29, 2024
4a6bc72
Merge branch 'transport-refs-7.8.8' into transport-refs-7.8.9
ctiller May 29, 2024
ca6c7fe
Merge branch 'transport-refs-7.8.9' into transport-refs-7.8.10
ctiller May 29, 2024
94c281c
Merge branch 'transport-refs-7.8.10' into transport-refs-8
ctiller May 29, 2024
60ac0d5
x
ctiller May 29, 2024
444f548
x
ctiller May 29, 2024
e019b8f
x
ctiller May 29, 2024
ae133fe
Merge branch 'transport-refs-7' into transport-refs-7.5
ctiller May 29, 2024
bf52787
Merge branch 'transport-refs-7.5' into transport-refs-7.7
ctiller May 29, 2024
ee15450
Merge branch 'transport-refs-7.7' into transport-refs-7.8
ctiller May 29, 2024
1e9bf7d
Merge branch 'transport-refs-7.8' into transport-refs-7.8.1
ctiller May 29, 2024
e1e2349
Merge branch 'transport-refs-7.8.1' into transport-refs-7.8.2
ctiller May 29, 2024
db4a493
Merge branch 'transport-refs-7.8.2' into transport-refs-7.8.3
ctiller May 29, 2024
64fdf8c
Merge branch 'transport-refs-7.8.3' into transport-refs-7.8.4
ctiller May 29, 2024
2684430
Merge branch 'transport-refs-7.8.4' into transport-refs-7.8.5
ctiller May 29, 2024
8e54e64
Merge branch 'transport-refs-7.8.5' into transport-refs-7.8.6
ctiller May 29, 2024
a5ffbdf
Merge branch 'transport-refs-7.8.6' into transport-refs-7.8.7
ctiller May 29, 2024
0347c35
Merge branch 'transport-refs-7.8.7' into transport-refs-7.8.8
ctiller May 29, 2024
8e9fdd3
Merge branch 'transport-refs-7.8.8' into transport-refs-7.8.9
ctiller May 29, 2024
1dee494
Merge branch 'transport-refs-7.8.9' into transport-refs-7.8.10
ctiller May 29, 2024
4dfcf70
Merge branch 'transport-refs-7.8.10' into transport-refs-8
ctiller May 29, 2024
6d9f06e
x
ctiller May 29, 2024
ac8d57d
x
ctiller May 29, 2024
bffc896
splits
ctiller May 29, 2024
3704462
x
ctiller May 30, 2024
badb6ce
x
ctiller May 30, 2024
aaaa32b
Merge branch 'master' into transport-refs-7
ctiller May 30, 2024
762f76d
Merge branch 'transport-refs-7' into transport-refs-7.5
ctiller May 30, 2024
8d81cd9
Merge branch 'transport-refs-7.5' into transport-refs-7.7
ctiller May 30, 2024
813d027
Merge branch 'transport-refs-7.7' into transport-refs-7.8
ctiller May 30, 2024
b2f7f23
Merge branch 'transport-refs-7.8' into transport-refs-7.8.1
ctiller May 30, 2024
99970f5
Merge branch 'transport-refs-7.8.1' into transport-refs-7.8.2
ctiller May 30, 2024
c6083b9
Merge branch 'transport-refs-7.8.2' into transport-refs-7.8.3
ctiller May 30, 2024
b8aab49
Merge branch 'transport-refs-7.8.3' into transport-refs-7.8.4
ctiller May 30, 2024
886b405
Merge branch 'transport-refs-7.8.4' into transport-refs-7.8.5
ctiller May 30, 2024
25ac677
Merge branch 'transport-refs-7.8.5' into transport-refs-7.8.6
ctiller May 30, 2024
4a10719
Merge branch 'transport-refs-7.8.6' into transport-refs-7.8.7
ctiller May 30, 2024
d577b7a
Merge branch 'transport-refs-7.8.7' into transport-refs-7.8.8
ctiller May 30, 2024
d725cee
Merge branch 'transport-refs-7.8.8' into transport-refs-7.8.9
ctiller May 30, 2024
c2b8109
Merge branch 'transport-refs-7.8.9' into transport-refs-7.8.10
ctiller May 30, 2024
d5ede41
Merge branch 'transport-refs-7.8.10' into transport-refs-8
ctiller May 30, 2024
b990d39
x
ctiller May 30, 2024
a9a5379
extract batch builder
ctiller May 30, 2024
975830a
x
ctiller May 30, 2024
0218373
x
ctiller May 30, 2024
f9fdc17
x
ctiller May 30, 2024
f303968
Automated change: Fix sanity tests
ctiller May 30, 2024
8e918da
Merge pull request #2131 from ctiller/create-pull-request/patch-f9fdc17
ctiller May 30, 2024
f71d86e
x
ctiller May 30, 2024
58a9395
fix1
ctiller May 30, 2024
b1deb94
x
ctiller May 30, 2024
f834a83
x
ctiller May 30, 2024
96bbdba
Merge branch 'master' into transport-refs-7
ctiller May 30, 2024
4c3f594
Merge branch 'transport-refs-7' into transport-refs-7.5
ctiller May 30, 2024
c98d94f
Merge branch 'transport-refs-7.5' into transport-refs-7.7
ctiller May 30, 2024
ebfac8c
Merge branch 'transport-refs-7.7' into transport-refs-7.8
ctiller May 30, 2024
350e51d
Merge branch 'transport-refs-7.8' into transport-refs-7.8.1
ctiller May 30, 2024
237b201
Merge branch 'transport-refs-7.8.1' into transport-refs-7.8.2
ctiller May 30, 2024
f473f30
Merge branch 'transport-refs-7.8.2' into transport-refs-7.8.3
ctiller May 30, 2024
e8be826
Merge branch 'transport-refs-7.8.3' into transport-refs-7.8.4
ctiller May 30, 2024
0f80dbb
Merge branch 'transport-refs-7.8.4' into transport-refs-7.8.5
ctiller May 30, 2024
fd2284a
Merge branch 'transport-refs-7.8.5' into transport-refs-7.8.6
ctiller May 30, 2024
74509f9
Merge branch 'transport-refs-7.8.6' into transport-refs-7.8.7
ctiller May 30, 2024
40b0691
Merge branch 'transport-refs-7.8.7' into transport-refs-7.8.8
ctiller May 30, 2024
b266307
Merge branch 'transport-refs-7.8.8' into transport-refs-7.8.9
ctiller May 30, 2024
40fa57e
Merge branch 'transport-refs-7.8.9' into transport-refs-7.8.10
ctiller May 30, 2024
a9ad772
Merge remote-tracking branch 'origin/transport-refs-8' into transport…
ctiller May 30, 2024
c30dfae
Merge branch 'transport-refs-7.8.10' into transport-refs-8
ctiller May 30, 2024
e47fc6c
x
ctiller May 30, 2024
3a84e07
x
ctiller May 30, 2024
cd1bb81
x
ctiller May 30, 2024
42f7d39
x
ctiller May 30, 2024
3862e68
extend-test
ctiller May 30, 2024
777925e
Merge branch 'master' into transport-refs-7
ctiller May 30, 2024
47e7e1c
Merge branch 'transport-refs-7' into transport-refs-7.5
ctiller May 30, 2024
d96e60b
Merge branch 'transport-refs-7.5' into transport-refs-7.7
ctiller May 30, 2024
9d0166f
Merge branch 'transport-refs-7.7' into transport-refs-7.8
ctiller May 30, 2024
f08fdd5
fix
ctiller May 30, 2024
0a03c54
cmt
ctiller May 30, 2024
a342072
cmt
ctiller May 30, 2024
7656baf
cmt
ctiller May 30, 2024
8a7b1f2
Merge branch 'transport-refs-7.8' into transport-refs-7.8.1
ctiller May 30, 2024
4a6d362
Merge branch 'transport-refs-7.8.1' into transport-refs-7.8.2
ctiller May 30, 2024
72dc190
Merge branch 'transport-refs-7.8.2' into transport-refs-7.8.3
ctiller May 30, 2024
dd39e10
Merge branch 'transport-refs-7.8.3' into transport-refs-7.8.4
ctiller May 30, 2024
cddd113
Merge branch 'transport-refs-7.8.4' into transport-refs-7.8.5
ctiller May 30, 2024
14a97d3
Merge branch 'transport-refs-7.8.5' into transport-refs-7.8.6
ctiller May 30, 2024
886db23
Merge branch 'transport-refs-7.8.6' into transport-refs-7.8.7
ctiller May 30, 2024
b9a044c
Merge branch 'transport-refs-7.8.7' into transport-refs-7.8.8
ctiller May 30, 2024
1dbdad2
Merge branch 'transport-refs-7.8.8' into transport-refs-7.8.9
ctiller May 30, 2024
75aaf58
Merge branch 'transport-refs-7.8.9' into transport-refs-7.8.10
ctiller May 30, 2024
026650b
Merge branch 'transport-refs-7.8.10' into transport-refs-8
ctiller May 30, 2024
fe7c2bc
Merge branch 'master' into transport-refs-7
ctiller May 30, 2024
d9fa012
Merge branch 'transport-refs-7' into transport-refs-7.5
ctiller May 30, 2024
1d7ab3b
Merge branch 'transport-refs-7.5' into transport-refs-7.7
ctiller May 30, 2024
f768c25
x
ctiller May 30, 2024
e689203
x
ctiller May 30, 2024
2869c10
Merge branch 'transport-refs-7.8' into transport-refs-7.8.1
ctiller May 30, 2024
6bbc1b8
Merge branch 'transport-refs-7.8.1' into transport-refs-7.8.2
ctiller May 30, 2024
a68a1ef
Merge branch 'transport-refs-7.8.2' into transport-refs-7.8.3
ctiller May 30, 2024
dd5c1b3
Merge branch 'transport-refs-7.8.3' into transport-refs-7.8.4
ctiller May 30, 2024
1dac773
Merge branch 'transport-refs-7.8.4' into transport-refs-7.8.5
ctiller May 30, 2024
08a02ae
Merge branch 'transport-refs-7.8.5' into transport-refs-7.8.6
ctiller May 30, 2024
5d9d319
Merge branch 'transport-refs-7.8.6' into transport-refs-7.8.7
ctiller May 30, 2024
a2f50cb
Merge branch 'transport-refs-7.8.7' into transport-refs-7.8.8
ctiller May 30, 2024
db7cffe
Merge branch 'transport-refs-7.8.8' into transport-refs-7.8.9
ctiller May 30, 2024
a4f0d15
Merge branch 'transport-refs-7.8.9' into transport-refs-7.8.10
ctiller May 30, 2024
e3557e1
Merge branch 'transport-refs-7.8.10' into transport-refs-8
ctiller May 30, 2024
f62948d
x
ctiller May 30, 2024
bb727c2
fix
ctiller May 30, 2024
c51f7ea
Merge branch 'master' into transport-refs-7
ctiller May 30, 2024
bbdac7f
Merge branch 'transport-refs-7' into transport-refs-7.5
ctiller May 30, 2024
c411e6e
Merge branch 'transport-refs-7.5' into transport-refs-7.7
ctiller May 30, 2024
53788ee
Merge branch 'transport-refs-7.7' into transport-refs-7.8
ctiller May 30, 2024
e053633
Merge branch 'transport-refs-7.8' into transport-refs-7.8.1
ctiller May 30, 2024
f580896
Merge branch 'transport-refs-7.8.1' into transport-refs-7.8.2
ctiller May 30, 2024
86cd739
Merge branch 'transport-refs-7.8.2' into transport-refs-7.8.3
ctiller May 30, 2024
7bc0f70
Merge branch 'transport-refs-7.8.3' into transport-refs-7.8.4
ctiller May 30, 2024
1b51851
Merge branch 'transport-refs-7.8.4' into transport-refs-7.8.5
ctiller May 30, 2024
8a91335
Merge branch 'transport-refs-7.8.5' into transport-refs-7.8.6
ctiller May 30, 2024
6a209be
Merge branch 'transport-refs-7.8.6' into transport-refs-7.8.7
ctiller May 30, 2024
aa020ef
Merge branch 'transport-refs-7.8.7' into transport-refs-7.8.8
ctiller May 30, 2024
185c5e1
Merge branch 'transport-refs-7.8.8' into transport-refs-7.8.9
ctiller May 30, 2024
c1bdc82
Merge branch 'transport-refs-7.8.9' into transport-refs-7.8.10
ctiller May 30, 2024
7a5e94c
Merge branch 'transport-refs-7.8.10' into transport-refs-8
ctiller May 30, 2024
68b8cf2
x
ctiller May 31, 2024
3ba3cb4
x
ctiller Jun 1, 2024
972846d
Automated change: Fix sanity tests
ctiller Jun 1, 2024
88e4ee2
Merge pull request #2178 from ctiller/create-pull-request/patch-3ba3cb4
ctiller Jun 1, 2024
3e751ed
Delete src/core/lib/channel/context.h
ctiller Jun 1, 2024
fb91f5b
x
ctiller Jun 1, 2024
5bf4c34
Merge branch 'nukage' of github.com:ctiller/grpc into nukage
ctiller Jun 1, 2024
2519339
Merge branch 'nukage' into transport-refs-8
ctiller Jun 3, 2024
1727e38
Merge branch 'transport-refs-8' into transport-refs-9
ctiller Jun 3, 2024
394abb4
Automated change: Fix sanity tests
ctiller Jun 3, 2024
ee1071a
Automated change: Fix sanity tests
ctiller Jun 3, 2024
0493c7a
testing
ctiller Jun 3, 2024
b90cc6b
Merge pull request #2180 from ctiller/create-pull-request/patch-2519339
ctiller Jun 3, 2024
4043d04
Merge pull request #2181 from ctiller/create-pull-request/patch-1727e38
ctiller Jun 3, 2024
77e7dec
x
ctiller Jun 3, 2024
5900d72
start new state machine
ctiller Jun 3, 2024
2afc531
Merge branch 'master' into nukage
ctiller Jun 3, 2024
df6b38b
Merge branch 'nukage' into transport-refs-8
ctiller Jun 3, 2024
a5948f2
test-fixes
ctiller Jun 3, 2024
3a00a3c
Merge branch 'master' into nukage
ctiller Jun 3, 2024
0dda1fd
Merge branch 'nukage' into transport-refs-8
ctiller Jun 3, 2024
3588ccf
Merge remote-tracking branch 'origin/transport-refs-9' into transport…
ctiller Jun 3, 2024
bc349ad
Merge branch 'transport-refs-8' into transport-refs-9
ctiller Jun 3, 2024
ab513b9
new state machine progress
ctiller Jun 4, 2024
9b96980
Merge branch 'master' into transport-refs-8
ctiller Jun 4, 2024
5e93a13
fix
ctiller Jun 4, 2024
3767b56
x
ctiller Jun 4, 2024
c5a1f8b
fix confusion between no picker (new channel) and no picker (we done)
ctiller Jun 4, 2024
ccd0707
fix
ctiller Jun 4, 2024
0697e3a
fmt
ctiller Jun 4, 2024
f8208cd
fix
ctiller Jun 4, 2024
e8cb706
fix
ctiller Jun 4, 2024
e484556
fix
ctiller Jun 4, 2024
0a0b19b
fix
ctiller Jun 4, 2024
7defa3e
merge
ctiller Jun 4, 2024
9e5515d
fmt
ctiller Jun 4, 2024
5a0aff2
x
ctiller Jun 4, 2024
efeae82
x
ctiller Jun 4, 2024
77723e1
x
ctiller Jun 4, 2024
1d727fb
strict
ctiller Jun 4, 2024
1733fe9
Merge branch 'master' into transport-refs-8
ctiller Jun 4, 2024
51cf92a
x
ctiller Jun 4, 2024
5695ff1
Merge branch 'transport-refs-8' into transport-refs-9
ctiller Jun 5, 2024
d927c0e
more work on new state machine
ctiller Jun 5, 2024
760ce22
Merge branch 'master' into transport-refs-8
ctiller Jun 6, 2024
677d647
Merge branch 'transport-refs-8' into transport-refs-9
ctiller Jun 6, 2024
c3ac367
progress
ctiller Jun 6, 2024
078b86d
progress
ctiller Jun 6, 2024
d9e5969
x
ctiller Jun 7, 2024
f1f08dc
new state machine compiles
ctiller Jun 10, 2024
d64852f
x
ctiller Jun 10, 2024
8b9ace2
x
ctiller Jun 10, 2024
8e3bd76
x
ctiller Jun 10, 2024
942d4f7
state-machine
ctiller Jun 11, 2024
192e85a
fix
ctiller Jun 11, 2024
af9b204
fix
ctiller Jun 11, 2024
b15f503
x
ctiller Jun 11, 2024
248a4eb
x
ctiller Jun 11, 2024
acfcf08
x
ctiller Jun 11, 2024
eaa4e67
x
ctiller Jun 11, 2024
9cbe41c
dont cancel if done
ctiller Jun 11, 2024
5b599ed
x
ctiller Jun 11, 2024
3560b1c
Merge github.com:grpc/grpc into transport-refs-9
ctiller Jun 12, 2024
e2c9d02
Merge github.com:grpc/grpc into transport-refs-9
ctiller Jun 13, 2024
d9a5f62
x
ctiller Jun 13, 2024
1b7dc38
x
ctiller Jun 13, 2024
2a3396b
x
ctiller Jun 13, 2024
cdfe0a7
fix
ctiller Jun 13, 2024
314e85d
fix
ctiller Jun 13, 2024
0dcee3a
fix
ctiller Jun 13, 2024
2477665
Merge github.com:grpc/grpc into transport-refs-9
ctiller Jun 13, 2024
16224d5
x
ctiller Jun 13, 2024
244977a
x
ctiller Jun 13, 2024
fa3aea7
x
ctiller Jun 13, 2024
1ec48d7
x
ctiller Jun 14, 2024
0a9a3bf
x
ctiller Jun 14, 2024
5cbc66b
x
ctiller Jun 14, 2024
eef8ac5
Merge github.com:grpc/grpc into transport-refs-9
ctiller Jun 14, 2024
3c82dea
x
ctiller Jun 14, 2024
b80906f
x
ctiller Jun 15, 2024
4a16fcc
x
ctiller Jun 15, 2024
17f25f6
x
ctiller Jun 16, 2024
612b788
x
ctiller Jun 16, 2024
3e2a80b
x
ctiller Jun 16, 2024
fbb2759
Merge branch 'master' into transport-refs-9
ctiller Jun 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,8 @@ grpc_cc_library(
"lib/promise/cancel_callback.h",
],
deps = [
"arena",
"context",
"promise_like",
"//:gpr_platform",
],
Expand Down Expand Up @@ -3593,7 +3595,6 @@ grpc_cc_library(
hdrs = ["load_balancing/subchannel_interface.h"],
external_deps = ["absl/status"],
deps = [
"call_destination",
"dual_ref_counted",
"iomgr_fwd",
"//:event_engine_base_hdrs",
Expand Down
87 changes: 75 additions & 12 deletions src/core/client_channel/client_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
#include "src/core/lib/promise/context.h"
#include "src/core/lib/promise/exec_ctx_wakeup_scheduler.h"
#include "src/core/lib/promise/latch.h"
#include "src/core/lib/promise/loop.h"
#include "src/core/lib/promise/map.h"
#include "src/core/lib/promise/pipe.h"
#include "src/core/lib/promise/poll.h"
Expand Down Expand Up @@ -122,6 +123,73 @@ extern TraceFlag grpc_client_channel_trace;
extern TraceFlag grpc_client_channel_call_trace;
extern TraceFlag grpc_client_channel_lb_call_trace;

//
// ClientChannel::SubchannelWrapper
//

class ClientChannel::SubchannelWrapper
: public SubchannelInterfaceWithCallDestination {
public:
SubchannelWrapper(RefCountedPtr<ClientChannel> client_channel,
RefCountedPtr<Subchannel> subchannel);
~SubchannelWrapper() override;

void Orphaned() override;
void WatchConnectivityState(
std::unique_ptr<ConnectivityStateWatcherInterface> watcher) override
ABSL_EXCLUSIVE_LOCKS_REQUIRED(*client_channel_->work_serializer_);
void CancelConnectivityStateWatch(
ConnectivityStateWatcherInterface* watcher) override
ABSL_EXCLUSIVE_LOCKS_REQUIRED(*client_channel_->work_serializer_);

RefCountedPtr<UnstartedCallDestination> call_destination() override {
return subchannel_->call_destination();
}

void RequestConnection() override { subchannel_->RequestConnection(); }

void ResetBackoff() override { subchannel_->ResetBackoff(); }

void AddDataWatcher(std::unique_ptr<DataWatcherInterface> watcher) override
ABSL_EXCLUSIVE_LOCKS_REQUIRED(*client_channel_->work_serializer_);
void CancelDataWatcher(DataWatcherInterface* watcher) override
ABSL_EXCLUSIVE_LOCKS_REQUIRED(*client_channel_->work_serializer_);
void ThrottleKeepaliveTime(int new_keepalive_time);

private:
class WatcherWrapper;

// A heterogenous lookup comparator for data watchers that allows
// unique_ptr keys to be looked up as raw pointers.
struct DataWatcherLessThan {
using is_transparent = void;
bool operator()(const std::unique_ptr<DataWatcherInterface>& p1,
const std::unique_ptr<DataWatcherInterface>& p2) const {
return p1 < p2;
}
bool operator()(const std::unique_ptr<DataWatcherInterface>& p1,
const DataWatcherInterface* p2) const {
return p1.get() < p2;
}
bool operator()(const DataWatcherInterface* p1,
const std::unique_ptr<DataWatcherInterface>& p2) const {
return p1 < p2.get();
}
};

RefCountedPtr<ClientChannel> client_channel_;
RefCountedPtr<Subchannel> subchannel_;
// Maps from the address of the watcher passed to us by the LB policy
// to the address of the WrapperWatcher that we passed to the underlying
// subchannel. This is needed so that when the LB policy calls
// CancelConnectivityStateWatch() with its watcher, we know the
// corresponding WrapperWatcher to cancel on the underlying subchannel.
std::map<ConnectivityStateWatcherInterface*, WatcherWrapper*> watcher_map_
ABSL_GUARDED_BY(*client_channel_->work_serializer_);
std::set<std::unique_ptr<DataWatcherInterface>, DataWatcherLessThan>
data_watchers_ ABSL_GUARDED_BY(*client_channel_->work_serializer_);
};

//
// ClientChannel::ResolverResultHandler
//
Expand Down Expand Up @@ -581,11 +649,6 @@ ClientChannel::ClientChannel(
default_authority_(
GetDefaultAuthorityFromChannelArgs(channel_args_, this->target())),
channelz_node_(channel_args_.GetObject<channelz::ChannelNode>()),
call_arena_allocator_(MakeRefCounted<CallArenaAllocator>(
channel_args_.GetObject<ResourceQuota>()
->memory_quota()
->CreateMemoryAllocator("client_channel"),
1024)),
idle_timeout_(GetClientIdleTimeout(channel_args_)),
resolver_data_for_calls_(ResolverDataForCalls{}),
picker_(nullptr),
Expand Down Expand Up @@ -655,7 +718,7 @@ grpc_connectivity_state ClientChannel::CheckConnectivityState(

void ClientChannel::WatchConnectivityState(grpc_connectivity_state, Timestamp,
grpc_completion_queue*, void*) {
// FIXME: implement
// TODO(ctiller): implement
Crash("not implemented");
}

Expand Down Expand Up @@ -730,6 +793,7 @@ class PingRequest {
} // namespace

void ClientChannel::Ping(grpc_completion_queue*, void*) {
// TODO(ctiller): implement
Crash("not implemented");
}

Expand All @@ -753,7 +817,7 @@ CallInitiator ClientChannel::CreateCall(
// Create an initiator/unstarted-handler pair.
auto call =
MakeCallPair(std::move(client_initial_metadata), event_engine_.get(),
call_arena_allocator_->MakeArena(), nullptr);
call_arena_allocator()->MakeArena(), nullptr);
// Spawn a promise to wait for the resolver result.
// This will eventually start the call.
call.initiator.SpawnGuardedUntilCallCompletes(
Expand Down Expand Up @@ -1179,7 +1243,6 @@ void ClientChannel::UpdateServiceConfigInDataPlaneLocked() {
MakeRefCounted<DefaultConfigSelector>(saved_service_config_);
}
// Construct filter stack.
// TODO(roth): Add service_config to channel_args_.
InterceptionChainBuilder builder(channel_args_.SetObject(this));
if (idle_timeout_ != Duration::Zero()) {
builder.AddOnServerTrailingMetadata([this](ServerMetadata&) {
Expand All @@ -1205,14 +1268,14 @@ void ClientChannel::UpdateServiceConfigInDataPlaneLocked() {
if (enable_retries) {
Crash("call v3 stack does not yet support retries");
}
auto filter_stack = builder.Build(call_destination_);
auto top_of_stack_call_destination = builder.Build(call_destination_);
// Send result to data plane.
if (!filter_stack.ok()) {
if (!top_of_stack_call_destination.ok()) {
resolver_data_for_calls_.Set(MaybeRewriteIllegalStatusCode(
filter_stack.status(), "channel construction"));
top_of_stack_call_destination.status(), "channel construction"));
} else {
resolver_data_for_calls_.Set(ResolverDataForCalls{
std::move(config_selector), std::move(*filter_stack)});
std::move(config_selector), std::move(*top_of_stack_call_destination)});
}
}

Expand Down
72 changes: 1 addition & 71 deletions src/core/client_channel/client_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,15 @@
#include "src/core/client_channel/subchannel.h"
#include "src/core/ext/filters/channel_idle/idle_filter_state.h"
#include "src/core/lib/gprpp/single_set_ptr.h"
#include "src/core/lib/promise/loop.h"
#include "src/core/lib/promise/observable.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/transport/call_filters.h"
#include "src/core/lib/transport/metadata.h"
#include "src/core/load_balancing/lb_policy.h"
#include "src/core/resolver/resolver.h"
#include "src/core/service_config/service_config.h"

namespace grpc_core {

class SubchannelInterfaceWithCallDestination : public SubchannelInterface {
public:
using SubchannelInterface::SubchannelInterface;
// Obtain the call destination for this subchannel.
virtual RefCountedPtr<UnstartedCallDestination> call_destination() = 0;
};

class ClientChannel : public Channel {
public:
// This class is a wrapper for Subchannel that hides details of the
Expand All @@ -56,67 +47,7 @@ class ClientChannel : public Channel {
// underlying subchannel is shared between channels, this wrapper will only
// be used within one channel, so it will always be synchronized by the
// control plane work_serializer.
class SubchannelWrapper : public SubchannelInterfaceWithCallDestination {
public:
SubchannelWrapper(RefCountedPtr<ClientChannel> client_channel,
RefCountedPtr<Subchannel> subchannel);
~SubchannelWrapper() override;

void Orphaned() override;
void WatchConnectivityState(
std::unique_ptr<ConnectivityStateWatcherInterface> watcher) override
ABSL_EXCLUSIVE_LOCKS_REQUIRED(*client_channel_->work_serializer_);
void CancelConnectivityStateWatch(
ConnectivityStateWatcherInterface* watcher) override
ABSL_EXCLUSIVE_LOCKS_REQUIRED(*client_channel_->work_serializer_);

RefCountedPtr<UnstartedCallDestination> call_destination() override {
return subchannel_->connected_subchannel()->unstarted_call_destination();
}

void RequestConnection() override { subchannel_->RequestConnection(); }

void ResetBackoff() override { subchannel_->ResetBackoff(); }

void AddDataWatcher(std::unique_ptr<DataWatcherInterface> watcher) override
ABSL_EXCLUSIVE_LOCKS_REQUIRED(*client_channel_->work_serializer_);
void CancelDataWatcher(DataWatcherInterface* watcher) override
ABSL_EXCLUSIVE_LOCKS_REQUIRED(*client_channel_->work_serializer_);
void ThrottleKeepaliveTime(int new_keepalive_time);

private:
class WatcherWrapper;

// A heterogenous lookup comparator for data watchers that allows
// unique_ptr keys to be looked up as raw pointers.
struct DataWatcherLessThan {
using is_transparent = void;
bool operator()(const std::unique_ptr<DataWatcherInterface>& p1,
const std::unique_ptr<DataWatcherInterface>& p2) const {
return p1 < p2;
}
bool operator()(const std::unique_ptr<DataWatcherInterface>& p1,
const DataWatcherInterface* p2) const {
return p1.get() < p2;
}
bool operator()(const DataWatcherInterface* p1,
const std::unique_ptr<DataWatcherInterface>& p2) const {
return p1 < p2.get();
}
};

RefCountedPtr<ClientChannel> client_channel_;
RefCountedPtr<Subchannel> subchannel_;
// Maps from the address of the watcher passed to us by the LB policy
// to the address of the WrapperWatcher that we passed to the underlying
// subchannel. This is needed so that when the LB policy calls
// CancelConnectivityStateWatch() with its watcher, we know the
// corresponding WrapperWatcher to cancel on the underlying subchannel.
std::map<ConnectivityStateWatcherInterface*, WatcherWrapper*> watcher_map_
ABSL_GUARDED_BY(*client_channel_->work_serializer_);
std::set<std::unique_ptr<DataWatcherInterface>, DataWatcherLessThan>
data_watchers_ ABSL_GUARDED_BY(*client_channel_->work_serializer_);
};
class SubchannelWrapper;

using PickerObservable =
Observable<RefCountedPtr<LoadBalancingPolicy::SubchannelPicker>>;
Expand Down Expand Up @@ -257,7 +188,6 @@ class ClientChannel : public Channel {
ClientChannelFactory* const client_channel_factory_;
const std::string default_authority_;
channelz::ChannelNode* const channelz_node_;
const RefCountedPtr<CallArenaAllocator> call_arena_allocator_;
GlobalStatsPluginRegistry::StatsPluginGroup stats_plugin_group_;

//
Expand Down
5 changes: 2 additions & 3 deletions src/core/client_channel/client_channel_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3454,9 +3454,8 @@ void ClientChannelFilter::FilterBasedLoadBalancedCall::CreateSubchannelCall() {
Slice* path = send_initial_metadata()->get_pointer(HttpPathMetadata());
CHECK_NE(path, nullptr);
SubchannelCall::Args call_args = {
connected_subchannel()->RefAsSubclass<ConnectedSubchannel>(), pollent_,
path->Ref(), /*start_time=*/0, arena_->GetContext<Call>()->deadline(),
arena_,
connected_subchannel()->Ref(), pollent_, path->Ref(), /*start_time=*/0,
arena_->GetContext<Call>()->deadline(), arena_,
// TODO(roth): When we implement hedging support, we will probably
// need to use a separate call context for each subchannel call.
call_context(), call_combiner_};
Expand Down
8 changes: 8 additions & 0 deletions src/core/client_channel/client_channel_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "src/core/lib/channel/context.h"
#include "src/core/lib/gprpp/unique_type_name.h"
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/transport/call_destination.h"
#include "src/core/load_balancing/lb_policy.h"
#include "src/core/service_config/service_config_call_data.h"
#include "src/core/telemetry/call_tracer.h"
Expand Down Expand Up @@ -79,6 +80,13 @@ struct ContextSubclass<ClientChannelServiceConfigCallData> {
using Base = ServiceConfigCallData;
};

class SubchannelInterfaceWithCallDestination : public SubchannelInterface {
public:
using SubchannelInterface::SubchannelInterface;
// Obtain the call destination for this subchannel.
virtual RefCountedPtr<UnstartedCallDestination> call_destination() = 0;
};

} // namespace grpc_core

#endif // GRPC_SRC_CORE_CLIENT_CHANNEL_CLIENT_CHANNEL_INTERNAL_H
15 changes: 8 additions & 7 deletions src/core/client_channel/load_balanced_call_destination.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "src/core/client_channel/client_channel_internal.h"
#include "src/core/client_channel/subchannel.h"
#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/promise/loop.h"
#include "src/core/telemetry/call_tracer.h"

namespace grpc_core {
Expand Down Expand Up @@ -157,7 +158,7 @@ T HandlePickResult(
// Does an LB pick for a call. Returns one of the following things:
// - Continue{}, meaning to queue the pick
// - a non-OK status, meaning to fail the call
// - a connected subchannel, meaning that the pick is complete
// - a call destination, meaning that the pick is complete
// When the pick is complete, pushes client_initial_metadata onto
// call_initiator. Also adds the subchannel call tracker (if any) to
// context.
Expand Down Expand Up @@ -190,13 +191,13 @@ LoopCtl<absl::StatusOr<RefCountedPtr<UnstartedCallDestination>>> PickSubchannel(
complete_pick->subchannel.get());
}
CHECK(complete_pick->subchannel != nullptr);
// Grab a ref to the connected subchannel while we're still
// Grab a ref to the call destination while we're still
// holding the data plane mutex.
auto call_destination =
DownCast<SubchannelInterfaceWithCallDestination*>(
complete_pick->subchannel.get())
->call_destination();
// If the subchannel has no connected subchannel (e.g., if the
// If the subchannel has no call destination (e.g., if the
// subchannel has moved out of state READY but the LB policy hasn't
// yet seen that change and given us a new picker), then just
// queue the pick. We'll try again as soon as we get a new picker.
Expand Down Expand Up @@ -302,10 +303,10 @@ void LoadBalancedCallDestination::StartCall(
absl::StatusOr<RefCountedPtr<UnstartedCallDestination>>,
bool>
pick_result) {
auto& connected_subchannel = std::get<0>(pick_result);
auto& call_destination = std::get<0>(pick_result);
const bool was_queued = std::get<1>(pick_result);
if (!connected_subchannel.ok()) {
return connected_subchannel.status();
if (!call_destination.ok()) {
return call_destination.status();
}
// LB pick is done, so indicate that we've committed.
auto* on_commit = MaybeGetContext<LbOnCommit>();
Expand All @@ -323,7 +324,7 @@ void LoadBalancedCallDestination::StartCall(
// Delegate to connected subchannel.
// FIXME: need to insert LbCallTracingFilter at the top of the
// stack
(*connected_subchannel)->StartCall(unstarted_handler);
(*call_destination)->StartCall(unstarted_handler);
return absl::OkStatus();
});
});
Expand Down
6 changes: 6 additions & 0 deletions src/core/client_channel/subchannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ class Subchannel final : public DualRefCounted<Subchannel> {
return connected_subchannel_;
}

RefCountedPtr<UnstartedCallDestination> call_destination() {
MutexLock lock(&mu_);
if (connected_subchannel_ == nullptr) return nullptr;
return connected_subchannel_->unstarted_call_destination();
}

// Attempt to connect to the backend. Has no effect if already connected.
void RequestConnection() ABSL_LOCKS_EXCLUDED(mu_);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ MessageHandle ChannelCompression::CompressMessage(
gpr_log(GPR_INFO, "CompressMessage: len=%" PRIdPTR " alg=%d flags=%d",
message->payload()->Length(), algorithm, message->flags());
}
auto* call_tracer = GetContext<CallTracerInterface>();
auto* call_tracer = MaybeGetContext<CallTracerInterface>();
if (call_tracer != nullptr) {
call_tracer->RecordSendMessage(*message->payload());
}
Expand Down Expand Up @@ -176,7 +176,7 @@ absl::StatusOr<MessageHandle> ChannelCompression::DecompressMessage(
message->payload()->Length(),
args.max_recv_message_length.value_or(-1), args.algorithm);
}
auto* call_tracer = GetContext<CallTracerInterface>();
auto* call_tracer = MaybeGetContext<CallTracerInterface>();
if (call_tracer != nullptr) {
call_tracer->RecordReceivedMessage(*message->payload());
}
Expand Down
Loading