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

Make SetUpCodePairer only browse for nodes that are in commissioning mode. #17356

Conversation

bzbarsky-apple
Copy link
Contributor

@bzbarsky-apple bzbarsky-apple commented Apr 13, 2022

If we don't browse for the _CM subtype, we might find (and ignore) a
node that's not yet in commissioning mode (but has extended
commissioning discovery turned on) and when it enters commissioning
mode we won't notice because there won't be any new service instances
of the sort we are looking for, just TXT record changes.

Problem

See above.

Change overview

Browse for _CM._sub._matterc._udp, then filter on discriminator, instead of browsing for _LNNN._sub._matterc._udp.

Testing

@bluebin14 tested this in his stress-test that caught the initial issue, and it seems to resolve it.

…mode.

If we don't browse for the _CM subtype, we might find (and ignore) a
node that's not yet in commissioning mode (but has extended
commissioning discovery turned on) and when it enters commissioning
mode we won't notice because there won't be any new service instances
of the sort we are looking for, just TXT record changes.
@bzbarsky-apple bzbarsky-apple force-pushed the setupcode-pairer-filter-commissionable branch from 7c1a1a2 to a0cfcbe Compare April 13, 2022 19:25
@github-actions
Copy link

github-actions bot commented Apr 13, 2022

PR #17356: Size comparison from b63d897 to a0cfcbe

Full report (29 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section b63d897 a0cfcbe change % change
cc13x2_26x2 lock-ftd LP_CC2652R7 (read only) 640435 640435 0 0.0
(read/write) 151212 151212 0 0.0
.bss 74144 74144 0 0.0
.data 3212 3212 0 0.0
.rodata 80227 80227 0 0.0
.text 559716 559716 0 0.0
lock-mtd LP_CC2652R7 (read only) 589171 589171 0 0.0
(read/write) 146932 146932 0 0.0
.bss 69864 69864 0 0.0
.data 3212 3212 0 0.0
.rodata 80107 80107 0 0.0
.text 508572 508572 0 0.0
pump-app LP_CC2652R7 (read only) 648519 648519 0 0.0
(read/write) 152508 152508 0 0.0
.bss 74640 74640 0 0.0
.data 3244 3244 0 0.0
.rodata 75415 75415 0 0.0
.text 572616 572616 0 0.0
pump-controller-app LP_CC2652R7 (read only) 642499 642499 0 0.0
(read/write) 152176 152176 0 0.0
.bss 74344 74344 0 0.0
.data 3208 3208 0 0.0
.rodata 79051 79051 0 0.0
.text 562960 562960 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 619042 619042 0 0.0
.app_xip_area 525752 525752 0 0.0
.bss 75956 75956 0 0.0
.data 684 684 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 576638 576638 0 0.0
.app_xip_area 484884 484884 0 0.0
.bss 74452 74452 0 0.0
.data 648 648 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 565170 565170 0 0.0
.app_xip_area 463788 463788 0 0.0
.bss 83784 83784 0 0.0
.data 564 564 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 908068 908068 0 0.0
(read/write) 133144 133144 0 0.0
.bss 131104 131104 0 0.0
.data 2040 2040 0 0.0
.text 908060 908060 0 0.0
BRD4161A+rpc (read only) 942436 942436 0 0.0
(read/write) 149828 149828 0 0.0
.bss 147584 147584 0 0.0
.data 2244 2244 0 0.0
.text 942428 942428 0 0.0
window-app BRD4161A (read only) 844724 844724 0 0.0
(read/write) 131148 131148 0 0.0
.bss 129200 129200 0 0.0
.data 1948 1948 0 0.0
.text 844716 844716 0 0.0
esp32 all-clusters-app c3devkit (read only) 979976 979976 0 0.0
(read/write) 1397578 1397578 0 0.0
.dram0.bss 62624 62624 0 0.0
.dram0.data 14420 14420 0 0.0
.flash.rodata 201616 201616 0 0.0
.flash.text 979976 979976 0 0.0
.iram0.text 62016 62016 0 0.0
m5stack (read only) 1035487 1035487 0 0.0
(read/write) 465316 465316 0 0.0
.dram0.bss 68144 68144 0 0.0
.dram0.data 34152 34152 0 0.0
.flash.rodata 231184 231184 0 0.0
.flash.text 1030103 1030103 0 0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 687260 687260 0 0.0
.bss 78128 78128 0 0.0
.data 2036 2036 0 0.0
.text 601296 601296 0 0.0
lock k32w061+release (read/write) 691892 691892 0 0.0
.bss 78704 78704 0 0.0
.data 1996 1996 0 0.0
.text 605392 605392 0 0.0
linux all-clusters-app debug (read only) 2697841 2697841 0 0.0
(read/write) 149216 149216 0 0.0
.bss 60192 60192 0 0.0
.data 1888 1888 0 0.0
.data.rel.ro 81080 81080 0 0.0
.dynamic 608 608 0 0.0
.got 4456 4456 0 0.0
.init 27 27 0 0.0
.init_array 984 984 0 0.0
.rodata 232421 232421 0 0.0
.text 2291426 2291426 0 0.0
bridge-app debug+rpc (read only) 1837453 1837453 0 0.0
(read/write) 91856 91856 0 0.0
.bss 44480 44480 0 0.0
.data 2912 2912 0 0.0
.data.rel.ro 39376 39376 0 0.0
.dynamic 592 592 0 0.0
.got 3936 3936 0 0.0
.init 27 27 0 0.0
.init_array 552 552 0 0.0
.rodata 148505 148505 0 0.0
.text 1570517 1570517 0 0.0
chip-tool debug (read only) 10684325 10684325 0 0.0
(read/write) 371832 371832 0 0.0
.bss 22752 22752 0 0.0
.data 1104 1104 0 0.0
.data.rel.ro 341728 341728 0 0.0
.dynamic 624 624 0 0.0
.got 4936 4936 0 0.0
.init 27 27 0 0.0
.init_array 656 656 0 0.0
.rodata 539093 539093 0 0.0
.text 9315925 9315925 0 0.0
door-lock-app debug (read only) 2108817 2108817 0 0.0
(read/write) 119600 119600 0 0.0
.bss 48064 48064 0 0.0
.data 1472 1472 0 0.0
.data.rel.ro 64504 64504 0 0.0
.dynamic 592 592 0 0.0
.got 4264 4264 0 0.0
.init 27 27 0 0.0
.init_array 680 680 0 0.0
.rodata 186697 186697 0 0.0
.text 1766418 1766418 0 0.0
lighting-app debug+rpc (read only) 2313657 2313657 0 0.0
(read/write) 127920 127920 0 0.0
.bss 50272 50272 0 0.0
.data 1952 1952 0 0.0
.data.rel.ro 69992 69992 0 0.0
.dynamic 608 608 0 0.0
.got 4312 4312 0 0.0
.init 27 27 0 0.0
.init_array 776 776 0 0.0
.rodata 182665 182665 0 0.0
.text 1965154 1965154 0 0.0
ota-provider-app debug (read only) 2045977 2045977 0 0.0
(read/write) 115296 115296 0 0.0
.bss 48224 48224 0 0.0
.data 1608 1608 0 0.0
.data.rel.ro 59720 59720 0 0.0
.dynamic 608 608 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 632 632 0 0.0
.rodata 172547 172547 0 0.0
.text 1717218 1717218 0 0.0
ota-requestor-app debug (read only) 2076409 2076409 0 0.0
(read/write) 118392 118392 0 0.0
.bss 48960 48960 0 0.0
.data 1864 1864 0 0.0
.data.rel.ro 61960 61960 0 0.0
.dynamic 592 592 0 0.0
.got 4304 4304 0 0.0
.init 27 27 0 0.0
.init_array 656 656 0 0.0
.rodata 169388 169388 0 0.0
.text 1748962 1748962 0 0.0
shell debug (read only) 2525713 2525713 0 0.0
(read/write) 150064 150064 0 0.0
.bss 67624 67624 0 0.0
.data 1264 1264 0 0.0
.data.rel.ro 75464 75464 0 0.0
.dynamic 592 592 0 0.0
.got 4168 4168 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 214738 214738 0 0.0
.text 2149810 2149810 0 0.0
tv-app debug (read only) 2797649 2797649 0 0.0
(read/write) 250784 250784 0 0.0
.bss 164112 164112 0 0.0
.data 4448 4448 0 0.0
.data.rel.ro 76008 76008 0 0.0
.dynamic 592 592 0 0.0
.got 4688 4688 0 0.0
.init 27 27 0 0.0
.init_array 904 904 0 0.0
.rodata 213387 213387 0 0.0
.text 2402962 2402962 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2369412 2369412 0 0.0
.bss 185236 185236 0 0.0
.data 5840 5840 0 0.0
.text 1332012 1332012 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1163491 1163491 0 0.0
bss 136528 136528 0 0.0
rodata 147364 147364 0 0.0
text 800968 800968 0 0.0
p6 all-clusters-app default (read/write) 2515120 2515120 0 0.0
.bss 118640 118640 0 0.0
.data 2768 2768 0 0.0
.text 1473384 1473384 0 0.0
light-app default (read/write) 2415592 2415592 0 0.0
.bss 112136 112136 0 0.0
.data 2576 2576 0 0.0
.text 1373856 1373856 0 0.0
lock-app default (read/write) 2379160 2379160 0 0.0
.bss 111880 111880 0 0.0
.data 2536 2536 0 0.0
.text 1337424 1337424 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 801524 801524 0 0.0
bss 69988 69988 0 0.0
noinit 40416 40416 0 0.0
text 570136 570136 0 0.0

Copy link
Contributor

@Damian-Nordic Damian-Nordic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving provided an updated comment to mention continuous query scenario.

@Damian-Nordic Damian-Nordic merged commit a689c84 into project-chip:master Apr 15, 2022
@bzbarsky-apple bzbarsky-apple deleted the setupcode-pairer-filter-commissionable branch April 15, 2022 15:03
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this pull request Jun 7, 2022
This reverts commit a689c84.

Now that we always register a new instance name when opening a new
commissioning window the problem PR project-chip#17356 was trying to work around
no longer applies.  On the other hand, the new setup introduced a new
problem: if there are multiple things advertising the _CM subtype
(i.e. multiple things in comissioning mode at once), then we might
find the first several (however much fits in a DNS packet) and then
platform mdns will stop delivering results, per
project-chip#19194 (which is
about Darwin, but other platforms have similar issues).

If we browse by discrimnator instead, the chance of multiple results
is much lower, and hence the chance of finding the thing we care about
is much higher.
bzbarsky-apple added a commit that referenced this pull request Jun 7, 2022
)

This reverts commit a689c84.

Now that we always register a new instance name when opening a new
commissioning window the problem PR #17356 was trying to work around
no longer applies.  On the other hand, the new setup introduced a new
problem: if there are multiple things advertising the _CM subtype
(i.e. multiple things in comissioning mode at once), then we might
find the first several (however much fits in a DNS packet) and then
platform mdns will stop delivering results, per
#19194 (which is
about Darwin, but other platforms have similar issues).

If we browse by discrimnator instead, the chance of multiple results
is much lower, and hence the chance of finding the thing we care about
is much higher.
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.

3 participants