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

When a client detects subscription drop, mark sessions defunct. #21841

Merged

Conversation

bzbarsky-apple
Copy link
Contributor

This marks defunct the session the subscripton is on, as well as any sessions
that are "more stale" than it, in the sense of not having seen anything from the
peer for at least as long. This should increase the chance that our next
attempt to communicate with the peer will not use a stale session.

Problem

Possible to have a stale session until a send attempt fails (and then we mark it defunct).

Change overview

Mark sessions defunct on subscription drop.

Testing

Created a subscription with resubscription disabled from chip-tool to all-clusters-app, then kill -9 on the all-clusters-app and restarted it. After the subscription timed out, tried to establish it again.

Before this PR, this re-establishment attempt timed out (and the next one succeeded). After this PR, we re-establish CASE on the subscription re-establishment attempt.

@github-actions github-actions bot added the app label Aug 11, 2022
This marks defunct the session the subscripton is on, as well as any sessions
that are "more stale" than it, in the sense of not having seen anything from the
peer for at least as long.  This should increase the chance that our next
attempt to communicate with the peer will not use a stale session.
@bzbarsky-apple bzbarsky-apple force-pushed the subscription-defunct-on-drop branch from dce6c1c to 1a9a51b Compare August 11, 2022 22:42
@github-actions
Copy link

github-actions bot commented Aug 11, 2022

PR #21841: Size comparison from c758e8b to 1a9a51b

Increases (43 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section c758e8b 1a9a51b change % change
bl602 lighting-app bl602 (read/write) 1381338 1381506 168 0.0
.text 1049336 1049508 172 0.0
bl602+rpc (read/write) 1426594 1426762 168 0.0
.text 1080840 1081008 168 0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 671767 671911 144 0.0
.text 582884 583028 144 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 637175 637319 144 0.0
.text 559028 559172 144 0.0
lock-ftd LP_CC2652R7 (read only) 673531 673675 144 0.0
.text 596544 596688 144 0.0
lock-mtd LP_CC2652R7 (read only) 656123 656275 152 0.0
.text 554184 554336 152 0.0
pump-app LP_CC2652R7 (read only) 683779 683923 144 0.0
.text 593884 594028 144 0.0
pump-controller-app LP_CC2652R7 (read only) 668231 668375 144 0.0
.text 582792 582936 144 0.0
shell LP_CC2652R7 (read only) 664450 664594 144 0.0
.text 578620 578764 144 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 585638 585790 152 0.0
.app_xip_area 462360 462512 152 0.0
lock cyw930739m2evb_01 (read/write) 591446 591598 152 0.0
.app_xip_area 463384 463536 152 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 598122 598258 136 0.0
.app_xip_area 475564 475700 136 0.0
efr32 lighting-app BRD4161A (read/write) 1098004 1098164 160 0.0
.text 962988 963148 160 0.0
BRD4161A+rpc (read/write) 1152268 1152428 160 0.0
.text 1000356 1000516 160 0.0
BRD4161A+rs911x (read/write) 987436 987596 160 0.0
.text 823096 823256 160 0.0
lock-app BRD4161A+wf200 (read/write) 1137540 1137684 144 0.0
.text 990552 990696 144 0.0
window-app BRD4161A (read/write) 1089440 1089600 160 0.0
.text 952968 953128 160 0.0
esp32 all-clusters-app c3devkit (read only) 1026976 1027146 170 0.0
.flash.text 1026976 1027146 170 0.0
m5stack (read only) 1080411 1080575 164 0.0
.flash.text 1075027 1075191 164 0.0
k32w light k32w0+release (read/write) 644572 644716 144 0.0
.text 570008 570152 144 0.0
lock k32w0+release (read/write) 701860 702004 144 0.0
.text 626816 626960 144 0.0
linux all-clusters-app debug (read only) 3030217 3031017 800 0.0
.text 2577618 2578418 800 0.0
all-clusters-minimal-app debug (read only) 2870041 2870841 800 0.0
.text 2419986 2420786 800 0.0
bridge-app debug+rpc (read only) 2368897 2369697 800 0.0
.text 2003762 2004562 800 0.0
chip-tool debug (read only) 10658593 10659393 800 0.0
.text 8600932 8601732 800 0.0
chip-tool-ipv6only arm64 (read only) 10068548 10069236 688 0.0
.text 7948724 7949412 688 0.0
lighting-app debug+rpc (read only) 2592881 2593681 800 0.0
.text 2202914 2203714 800 0.0
lock-app debug (read only) 2576857 2577657 800 0.0
.text 2173826 2174626 800 0.0
ota-provider-app debug (read only) 2353985 2354785 800 0.0
.text 1982194 1982994 800 0.0
ota-requestor-app debug (read only) 2519729 2520513 784 0.0
.text 2132082 2132866 784 0.0
shell debug (read only) 2598553 2599337 784 0.0
.text 2206546 2207330 784 0.0
thermostat-no-ble arm64 (read only) 2353268 2353956 688 0.0
.text 1975904 1976592 688 0.0
tv-app debug (read only) 3172329 3173129 800 0.0
.text 2724130 2724930 800 0.0
tv-casting-app debug (read only) 5412761 5413545 784 0.0
.text 4802786 4803570 784 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read/write) 2453376 2453568 192 0.0
.text 1416020 1416212 192 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1179087 1179231 144 0.0
text 813992 814136 144 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1158983 1159127 144 0.0
text 802980 803128 148 0.0
p6 all-clusters-app default (read/write) 1695180 1695340 160 0.0
.text 1534896 1535056 160 0.0
all-clusters-minimal-app default (read/write) 1639220 1639380 160 0.0
.text 1479656 1479816 160 0.0
light-app default (read/write) 1557932 1558092 160 0.0
.text 1406688 1406848 160 0.0
lock-app default (read/write) 1595100 1595260 160 0.0
.text 1439360 1439520 160 0.0
telink light-switch-app tlsr9518adk80d (read/write) 807140 807308 168 0.0
text 570660 570828 168 0.0
lighting-app tlsr9518adk80d (read/write) 829068 829236 168 0.0
text 588740 588908 168 0.0
Decreases (6 builds for cc13x2_26x2)
platform target config section c758e8b 1a9a51b change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read/write) 179688 179544 -144 -0.1
lock-ftd LP_CC2652R7 (read/write) 168116 167972 -144 -0.1
lock-mtd LP_CC2652R7 (read/write) 181212 181060 -152 -0.1
pump-app LP_CC2652R7 (read/write) 158676 158532 -144 -0.1
pump-controller-app LP_CC2652R7 (read/write) 174344 174200 -144 -0.1
shell LP_CC2652R7 (read/write) 182524 182380 -144 -0.1
Full report (43 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section c758e8b 1a9a51b change % change
bl602 lighting-app bl602 (read/write) 1381338 1381506 168 0.0
.bss 119826 119826 0 0.0
.data 4480 4480 0 0.0
.text 1049336 1049508 172 0.0
bl602+rpc (read/write) 1426594 1426762 168 0.0
.bss 127266 127266 0 0.0
.data 4600 4600 0 0.0
.text 1080840 1081008 168 0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 671767 671911 144 0.0
(read/write) 179688 179544 -144 -0.1
.bss 74348 74348 0 0.0
.data 3372 3372 0 0.0
.rodata 88567 88567 0 0.0
.text 582884 583028 144 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 637175 637319 144 0.0
(read/write) 157924 157924 0 0.0
.bss 73636 73636 0 0.0
.data 3372 3372 0 0.0
.rodata 77823 77823 0 0.0
.text 559028 559172 144 0.0
lock-ftd LP_CC2652R7 (read only) 673531 673675 144 0.0
(read/write) 168116 167972 -144 -0.1
.bss 71428 71428 0 0.0
.data 3296 3296 0 0.0
.rodata 76507 76507 0 0.0
.text 596544 596688 144 0.0
lock-mtd LP_CC2652R7 (read only) 656123 656275 152 0.0
(read/write) 181212 181060 -152 -0.1
.bss 67116 67116 0 0.0
.data 3296 3296 0 0.0
.rodata 101459 101459 0 0.0
.text 554184 554336 152 0.0
pump-app LP_CC2652R7 (read only) 683779 683923 144 0.0
(read/write) 158676 158532 -144 -0.1
.bss 71468 71468 0 0.0
.data 3296 3296 0 0.0
.rodata 89411 89411 0 0.0
.text 593884 594028 144 0.0
pump-controller-app LP_CC2652R7 (read only) 668231 668375 144 0.0
(read/write) 174344 174200 -144 -0.1
.bss 71588 71588 0 0.0
.data 3292 3292 0 0.0
.rodata 84959 84959 0 0.0
.text 582792 582936 144 0.0
shell LP_CC2652R7 (read only) 664450 664594 144 0.0
(read/write) 182524 182380 -144 -0.1
.bss 76668 76668 0 0.0
.data 3376 3376 0 0.0
.rodata 85514 85514 0 0.0
.text 578620 578764 144 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 585638 585790 152 0.0
.app_xip_area 462360 462512 152 0.0
.bss 65720 65720 0 0.0
.data 744 744 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 591446 591598 152 0.0
.app_xip_area 463384 463536 152 0.0
.bss 70504 70504 0 0.0
.data 748 748 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 598122 598258 136 0.0
.app_xip_area 475564 475700 136 0.0
.bss 65032 65032 0 0.0
.data 716 716 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read/write) 1098004 1098164 160 0.0
.bss 132924 132924 0 0.0
.data 2068 2068 0 0.0
.text 962988 963148 160 0.0
BRD4161A+rpc (read/write) 1152268 1152428 160 0.0
.bss 149612 149612 0 0.0
.data 2280 2280 0 0.0
.text 1000356 1000516 160 0.0
BRD4161A+rs911x (read/write) 987436 987596 160 0.0
.bss 162264 162264 0 0.0
.data 2056 2056 0 0.0
.text 823096 823256 160 0.0
lock-app BRD4161A+wf200 (read/write) 1137540 1137684 144 0.0
.bss 144904 144904 0 0.0
.data 2064 2064 0 0.0
.text 990552 990696 144 0.0
window-app BRD4161A (read/write) 1089440 1089600 160 0.0
.bss 134356 134356 0 0.0
.data 2096 2096 0 0.0
.text 952968 953128 160 0.0
esp32 all-clusters-app c3devkit (read only) 1026976 1027146 170 0.0
(read/write) 1487642 1487642 0 0.0
.dram0.bss 70424 70424 0 0.0
.dram0.data 14600 14600 0 0.0
.flash.rodata 217176 217176 0 0.0
.flash.text 1026976 1027146 170 0.0
.iram0.text 62902 62902 0 0.0
m5stack (read only) 1080411 1080575 164 0.0
(read/write) 489600 489600 0 0.0
.dram0.bss 75928 75928 0 0.0
.dram0.data 34144 34144 0 0.0
.flash.rodata 247532 247532 0 0.0
.flash.text 1075027 1075191 164 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w0+release (read/write) 644572 644716 144 0.0
.bss 69792 69792 0 0.0
.data 2044 2044 0 0.0
.text 570008 570152 144 0.0
lock k32w0+release (read/write) 701860 702004 144 0.0
.bss 70264 70264 0 0.0
.data 2052 2052 0 0.0
.text 626816 626960 144 0.0
linux all-clusters-app debug (read only) 3030217 3031017 800 0.0
(read/write) 155760 155760 0 0.0
.bss 61888 61888 0 0.0
.data 2096 2096 0 0.0
.data.rel.ro 85416 85416 0 0.0
.dynamic 608 608 0 0.0
.got 4568 4568 0 0.0
.init 27 27 0 0.0
.init_array 1160 1160 0 0.0
.rodata 273643 273643 0 0.0
.text 2577618 2578418 800 0.0
all-clusters-minimal-app debug (read only) 2870041 2870841 800 0.0
(read/write) 147496 147496 0 0.0
.bss 61152 61152 0 0.0
.data 2064 2064 0 0.0
.data.rel.ro 78008 78008 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 1152 1152 0 0.0
.rodata 273803 273803 0 0.0
.text 2419986 2420786 800 0.0
bridge-app debug+rpc (read only) 2368897 2369697 800 0.0
(read/write) 127456 127456 0 0.0
.bss 50624 50624 0 0.0
.data 3600 3600 0 0.0
.data.rel.ro 67368 67368 0 0.0
.dynamic 608 608 0 0.0
.got 4392 4392 0 0.0
.init 27 27 0 0.0
.init_array 824 824 0 0.0
.rodata 202632 202632 0 0.0
.text 2003762 2004562 800 0.0
chip-tool debug (read only) 10658593 10659393 800 0.0
(read/write) 650816 650816 0 0.0
.bss 25240 25240 0 0.0
.data 3266 3266 0 0.0
.data.rel.ro 615784 615784 0 0.0
.dynamic 608 608 0 0.0
.got 5104 5104 0 0.0
.init 27 27 0 0.0
.init_array 768 768 0 0.0
.rodata 551893 551893 0 0.0
.text 8600932 8601732 800 0.0
chip-tool-ipv6only arm64 (read only) 10068548 10069236 688 0.0
(read/write) 698577 698577 0 0.0
.bss 33281 33281 0 0.0
.data 3272 3272 0 0.0
.data.rel.ro 643344 643344 0 0.0
.dynamic 560 560 0 0.0
.got 13712 13712 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 482900 482900 0 0.0
.text 7948724 7949412 688 0.0
lighting-app debug+rpc (read only) 2592881 2593681 800 0.0
(read/write) 130048 130048 0 0.0
.bss 49760 49760 0 0.0
.data 2096 2096 0 0.0
.data.rel.ro 72248 72248 0 0.0
.dynamic 608 608 0 0.0
.got 4392 4392 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 219376 219376 0 0.0
.text 2202914 2203714 800 0.0
lock-app debug (read only) 2576857 2577657 800 0.0
(read/write) 125416 125416 0 0.0
.bss 48288 48288 0 0.0
.data 1712 1712 0 0.0
.data.rel.ro 69416 69416 0 0.0
.dynamic 608 608 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 896 896 0 0.0
.rodata 236496 236496 0 0.0
.text 2173826 2174626 800 0.0
ota-provider-app debug (read only) 2353985 2354785 800 0.0
(read/write) 118848 118848 0 0.0
.bss 47808 47808 0 0.0
.data 1936 1936 0 0.0
.data.rel.ro 63224 63224 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 760 760 0 0.0
.rodata 208440 208440 0 0.0
.text 1982194 1982994 800 0.0
ota-requestor-app debug (read only) 2519729 2520513 784 0.0
(read/write) 127192 127192 0 0.0
.bss 50304 50304 0 0.0
.data 2304 2304 0 0.0
.data.rel.ro 68632 68632 0 0.0
.dynamic 608 608 0 0.0
.got 4480 4480 0 0.0
.init 27 27 0 0.0
.init_array 848 848 0 0.0
.rodata 215200 215200 0 0.0
.text 2132082 2132866 784 0.0
shell debug (read only) 2598553 2599337 784 0.0
(read/write) 141912 141912 0 0.0
.bss 57800 57800 0 0.0
.data 1264 1264 0 0.0
.data.rel.ro 77024 77024 0 0.0
.dynamic 608 608 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 1032 1032 0 0.0
.rodata 233778 233778 0 0.0
.text 2206546 2207330 784 0.0
thermostat-no-ble arm64 (read only) 2353268 2353956 688 0.0
(read/write) 141681 141681 0 0.0
.bss 55313 55313 0 0.0
.data 1672 1672 0 0.0
.data.rel.ro 75880 75880 0 0.0
.dynamic 560 560 0 0.0
.got 5040 5040 0 0.0
.init 24 24 0 0.0
.init_array 408 408 0 0.0
.rodata 139836 139836 0 0.0
.text 1975904 1976592 688 0.0
tv-app debug (read only) 3172329 3173129 800 0.0
(read/write) 257872 257872 0 0.0
.bss 167480 167480 0 0.0
.data 4736 4736 0 0.0
.data.rel.ro 79096 79096 0 0.0
.dynamic 608 608 0 0.0
.got 4864 4864 0 0.0
.init 27 27 0 0.0
.init_array 1072 1072 0 0.0
.rodata 258408 258408 0 0.0
.text 2724130 2724930 800 0.0
tv-casting-app debug (read only) 5412761 5413545 784 0.0
(read/write) 158992 158992 0 0.0
.bss 51448 51448 0 0.0
.data 2432 2432 0 0.0
.data.rel.ro 98672 98672 0 0.0
.dynamic 608 608 0 0.0
.got 4784 4784 0 0.0
.init 27 27 0 0.0
.init_array 1040 1040 0 0.0
.rodata 341649 341649 0 0.0
.text 4802786 4803570 784 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2453376 2453568 192 0.0
.bss 214636 214636 0 0.0
.data 5872 5872 0 0.0
.text 1416020 1416212 192 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1179087 1179231 144 0.0
bss 143294 143294 0 0.0
rodata 142896 142896 0 0.0
text 813992 814136 144 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1158983 1159127 144 0.0
bss 142532 142532 0 0.0
rodata 134592 134592 0 0.0
text 802980 803128 148 0.0
p6 all-clusters-app default (read only) 881448 881448 0 0.0
(read/write) 1695180 1695340 160 0.0
.bss 149240 149240 0 0.0
.data 2656 2656 0 0.0
.text 1534896 1535056 160 0.0
all-clusters-minimal-app default (read only) 882168 882168 0 0.0
(read/write) 1639220 1639380 160 0.0
.bss 148520 148520 0 0.0
.data 2656 2656 0 0.0
.text 1479656 1479816 160 0.0
light-app default (read only) 890488 890488 0 0.0
(read/write) 1557932 1558092 160 0.0
.bss 140408 140408 0 0.0
.data 2448 2448 0 0.0
.text 1406688 1406848 160 0.0
lock-app default (read only) 885992 885992 0 0.0
(read/write) 1595100 1595260 160 0.0
.bss 144888 144888 0 0.0
.data 2464 2464 0 0.0
.text 1439360 1439520 160 0.0
telink light-switch-app tlsr9518adk80d (read/write) 807140 807308 168 0.0
bss 71040 71040 0 0.0
noinit 43488 43488 0 0.0
text 570660 570828 168 0.0
lighting-app tlsr9518adk80d (read/write) 829068 829236 168 0.0
bss 71896 71896 0 0.0
noinit 43488 43488 0 0.0
text 588740 588908 168 0.0

src/app/ReadClient.cpp Show resolved Hide resolved
@woody-apple woody-apple merged commit 078d765 into project-chip:master Aug 15, 2022
@bzbarsky-apple bzbarsky-apple deleted the subscription-defunct-on-drop branch August 26, 2022 21:41
isiu-apple pushed a commit to isiu-apple/connectedhomeip that referenced this pull request Sep 16, 2022
…ect-chip#21841)

This marks defunct the session the subscripton is on, as well as any sessions
that are "more stale" than it, in the sense of not having seen anything from the
peer for at least as long.  This should increase the chance that our next
attempt to communicate with the peer will not use a stale session.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants