Skip to content

CASESessionManager: don't release an in-flight CASE setup#72255

Open
woody-apple wants to merge 1 commit into
project-chip:masterfrom
woody-apple:case-no-teardown-in-flight
Open

CASESessionManager: don't release an in-flight CASE setup#72255
woody-apple wants to merge 1 commit into
project-chip:masterfrom
woody-apple:case-no-teardown-in-flight

Conversation

@woody-apple
Copy link
Copy Markdown
Contributor

@woody-apple woody-apple commented May 29, 2026

CASESessionManager::ReleaseSession(peerId) destroys the peer's OperationalSessionSetup even when it is mid-handshake, discarding the retry state (attempt count, busy-delay, exponential backoff). A higher layer calling ReleaseSession during cold-start can repeatedly tear down in-flight Sigma1/Sigma2 attempts, so each new attempt starts fresh, the longer backoff intervals are never reached, and a busy peer keeps returning BUSY for tens of seconds. This gates ReleaseSession on a new OperationalSessionSetup::IsEstablishingSession() accessor so in-flight setups are left to complete or follow their own retry cycle; established/uninitialized setups still release as before. See commit message for details.

Testing

Built locally and ran the CASE / OperationalSessionSetup unit tests. Manual repro: trigger a higher-layer ReleaseSession during an in-flight CASE handshake to a slow/busy peer and confirm the retry/backoff state is preserved (no fresh-ephemeral restart loop), while established and uninitialized sessions still release as before.

Testing

  • Unit tests added in this PR (see commit changes).
  • See PR description above for the regression scenarios covered.

@github-actions github-actions Bot added the app label May 29, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request modifies CASESessionManager::ReleaseSession to skip releasing a session if it is currently in the process of being established, introducing a helper method IsEstablishingSession in OperationalSessionSetup. However, the reviewer pointed out a critical issue: silently skipping the release can lead to use-after-free crashes, resource leaks, and an inability to cancel in-flight connection attempts.

Comment thread src/app/CASESessionManager.cpp
@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.58%. Comparing base (cdb3872) to head (f8543c1).
⚠️ Report is 11 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #72255      +/-   ##
==========================================
+ Coverage   55.52%   55.58%   +0.06%     
==========================================
  Files        1629     1630       +1     
  Lines      111092   111133      +41     
  Branches    13415    13405      -10     
==========================================
+ Hits        61683    61777      +94     
+ Misses      49409    49356      -53     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

PR #72255: Size comparison from 8ad5f7b to a667d15

Full report (35 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section 8ad5f7b a667d15 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094196 1094196 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105508 1105508 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593280 1593280 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057208 1057208 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896004 896004 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776932 776932 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789628 789628 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738752 738752 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718908 718908 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568670 568670 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596166 596166 0 0.0
RAM 205256 205256 0 0.0
efr32 lock-app BRD4187C FLASH 994072 994072 0 0.0
RAM 131288 131288 0 0.0
BRD4338a FLASH 798669 798661 -8 -0.0
RAM 243424 243424 0 0.0
window-app BRD4187C FLASH 1100496 1100496 0 0.0
RAM 130360 130360 0 0.0
esp32 all-clusters-app c3devkit DRAM 99716 99716 0 0.0
FLASH 1621488 1621488 0 0.0
IRAM 94776 94776 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834236 834236 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733900 1733900 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622692 1622692 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470180 1470180 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503316 1503316 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845060 845060 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783808 783808 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688600 688600 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729664 729664 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478372 478372 0 0.0
RAM 141476 141476 0 0.0
telink all-devices-app tl7218x FLASH 813010 813010 0 0.0
RAM 97196 97196 0 0.0
tlsr9118bdk40d FLASH 606462 606462 0 0.0
RAM 120152 120152 0 0.0
bridge-app tl7218x FLASH 731374 731374 0 0.0
RAM 95864 95864 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 851730 851730 0 0.0
RAM 44332 44332 0 0.0
tl7218x FLASH 843058 843058 0 0.0
RAM 99656 99656 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 731864 731864 0 0.0
RAM 55980 55980 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 795090 795090 0 0.0
RAM 75164 75164 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 731794 731794 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 614510 614510 0 0.0
RAM 118496 118496 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 841172 841176 4 0.0
RAM 97364 97364 0 0.0

@github-actions github-actions Bot added the tests label May 29, 2026
@github-actions
Copy link
Copy Markdown

PR #72255: Size comparison from 8ad5f7b to be9ffbd

Full report (5 builds for cc32xx, realtek, stm32)
platform target config section 8ad5f7b be9ffbd change % change
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568670 568670 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596166 596166 0 0.0
RAM 205256 205256 0 0.0
realtek light-switch-app rtl8777g FLASH 688600 688600 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729664 729664 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478372 478372 0 0.0
RAM 141476 141476 0 0.0

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

PR #72255: Size comparison from 8ad5f7b to 1a3c634

Full report (35 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section 8ad5f7b 1a3c634 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094196 1094196 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105508 1105508 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593280 1593280 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057208 1057208 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896004 896004 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776932 776932 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789628 789628 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738752 738752 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718908 718908 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568670 568670 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596166 596166 0 0.0
RAM 205256 205256 0 0.0
efr32 lock-app BRD4187C FLASH 994072 994072 0 0.0
RAM 131288 131288 0 0.0
BRD4338a FLASH 798669 798661 -8 -0.0
RAM 243424 243424 0 0.0
window-app BRD4187C FLASH 1100496 1100496 0 0.0
RAM 130360 130360 0 0.0
esp32 all-clusters-app c3devkit DRAM 99716 99716 0 0.0
FLASH 1621488 1621488 0 0.0
IRAM 94776 94776 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834236 834236 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733900 1733900 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622692 1622692 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470180 1470180 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503316 1503316 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845060 845060 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783808 783808 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688600 688600 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729664 729664 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478372 478372 0 0.0
RAM 141476 141476 0 0.0
telink all-devices-app tl7218x FLASH 813010 813010 0 0.0
RAM 97196 97196 0 0.0
tlsr9118bdk40d FLASH 606462 606462 0 0.0
RAM 120152 120152 0 0.0
bridge-app tl7218x FLASH 731374 731374 0 0.0
RAM 95864 95864 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 851730 851730 0 0.0
RAM 44332 44332 0 0.0
tl7218x FLASH 843058 843058 0 0.0
RAM 99656 99656 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 731864 731864 0 0.0
RAM 55980 55980 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 795090 795090 0 0.0
RAM 75164 75164 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 731794 731794 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 614510 614510 0 0.0
RAM 118496 118496 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 841172 841176 4 0.0
RAM 97364 97364 0 0.0

@woody-apple woody-apple force-pushed the case-no-teardown-in-flight branch 2 times, most recently from d903222 to 9a3e4e5 Compare May 30, 2026 04:58
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 30, 2026

PR #72255: Size comparison from 4894db9 to a9d164a

Full report (35 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section 4894db9 a9d164a change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094216 1094216 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105524 1105524 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593296 1593296 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057224 1057224 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896020 896020 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776944 776944 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789640 789640 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738772 738772 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718928 718928 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568690 568690 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596178 596178 0 0.0
RAM 205256 205256 0 0.0
efr32 lock-app BRD4187C FLASH 994060 994060 0 0.0
RAM 131288 131288 0 0.0
BRD4338a FLASH 798629 798629 0 0.0
RAM 243424 243424 0 0.0
window-app BRD4187C FLASH 1100480 1100480 0 0.0
RAM 130360 130360 0 0.0
esp32 all-clusters-app c3devkit DRAM 99716 99716 0 0.0
FLASH 1621508 1621508 0 0.0
IRAM 94776 94776 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834248 834248 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733916 1733916 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622708 1622708 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470196 1470196 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503332 1503332 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845080 845080 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783812 783812 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688624 688624 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729680 729680 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478384 478384 0 0.0
RAM 141476 141476 0 0.0
telink all-devices-app tl7218x FLASH 813028 813028 0 0.0
RAM 97196 97196 0 0.0
tlsr9118bdk40d FLASH 606480 606480 0 0.0
RAM 120152 120152 0 0.0
bridge-app tl7218x FLASH 731392 731392 0 0.0
RAM 95864 95864 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 851748 851748 0 0.0
RAM 44332 44332 0 0.0
tl7218x FLASH 843076 843076 0 0.0
RAM 99656 99656 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 731882 731882 0 0.0
RAM 55980 55980 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 795108 795108 0 0.0
RAM 75164 75164 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 731812 731812 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 614528 614528 0 0.0
RAM 118496 118496 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 841190 841194 4 0.0
RAM 97364 97364 0 0.0

@woody-apple woody-apple force-pushed the case-no-teardown-in-flight branch from a9d164a to 69da3aa Compare May 30, 2026 07:56
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 30, 2026

PR #72255: Size comparison from 4894db9 to 5d1a7b3

Full report (20 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, psoc6, qpg, realtek, stm32)
platform target config section 4894db9 5d1a7b3 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094216 1094216 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105524 1105524 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593296 1593296 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057224 1057224 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896020 896020 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776944 776944 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789640 789640 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738772 738772 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718928 718928 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568690 568690 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596178 596178 0 0.0
RAM 205256 205256 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733916 1733916 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622708 1622708 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470196 1470196 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503332 1503332 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845080 845080 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783812 783812 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688624 688624 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729680 729680 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478384 478384 0 0.0
RAM 141476 141476 0 0.0

@woody-apple woody-apple force-pushed the case-no-teardown-in-flight branch from 5d1a7b3 to 23ffd84 Compare May 30, 2026 08:49
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 30, 2026

PR #72255: Size comparison from 8a162c6 to 231a796

Full report (35 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section 8a162c6 231a796 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094216 1094216 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105524 1105524 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593296 1593296 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057224 1057224 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896020 896020 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776944 776944 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789640 789640 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738772 738772 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718928 718928 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568690 568690 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596178 596178 0 0.0
RAM 205256 205256 0 0.0
efr32 lock-app BRD4187C FLASH 994060 994060 0 0.0
RAM 131288 131288 0 0.0
BRD4338a FLASH 798629 798629 0 0.0
RAM 243424 243424 0 0.0
window-app BRD4187C FLASH 1100480 1100480 0 0.0
RAM 130360 130360 0 0.0
esp32 all-clusters-app c3devkit DRAM 99716 99716 0 0.0
FLASH 1621508 1621508 0 0.0
IRAM 94776 94776 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834248 834248 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733916 1733916 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622708 1622708 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470196 1470196 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503332 1503332 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845080 845080 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783812 783812 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688624 688624 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729680 729680 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478384 478384 0 0.0
RAM 141476 141476 0 0.0
telink all-devices-app tl7218x FLASH 813028 813028 0 0.0
RAM 97196 97196 0 0.0
tlsr9118bdk40d FLASH 606480 606480 0 0.0
RAM 120152 120152 0 0.0
bridge-app tl7218x FLASH 731392 731392 0 0.0
RAM 95864 95864 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 851748 851748 0 0.0
RAM 44332 44332 0 0.0
tl7218x FLASH 843076 843076 0 0.0
RAM 99656 99656 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 731882 731882 0 0.0
RAM 55980 55980 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 795108 795108 0 0.0
RAM 75164 75164 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 731812 731812 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 614528 614528 0 0.0
RAM 118496 118496 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 841190 841194 4 0.0
RAM 97364 97364 0 0.0

@woody-apple woody-apple marked this pull request as ready for review May 31, 2026 03:05
Copilot AI review requested due to automatic review settings May 31, 2026 03:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@woody-apple woody-apple force-pushed the case-no-teardown-in-flight branch from 231a796 to 23456c2 Compare May 31, 2026 03:25
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 31, 2026

PR #72255: Size comparison from 8a162c6 to 23456c2

Full report (35 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section 8a162c6 23456c2 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094216 1094216 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105524 1105524 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593296 1593296 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057224 1057224 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896020 896020 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776944 776944 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789640 789640 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738772 738772 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718928 718928 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568690 568690 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596178 596178 0 0.0
RAM 205256 205256 0 0.0
efr32 lock-app BRD4187C FLASH 994060 994060 0 0.0
RAM 131288 131288 0 0.0
BRD4338a FLASH 798629 798629 0 0.0
RAM 243424 243424 0 0.0
window-app BRD4187C FLASH 1100480 1100480 0 0.0
RAM 130360 130360 0 0.0
esp32 all-clusters-app c3devkit DRAM 99716 99716 0 0.0
FLASH 1621508 1621508 0 0.0
IRAM 94776 94776 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834248 834248 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733916 1733916 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622708 1622708 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470196 1470196 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503332 1503332 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845080 845080 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783812 783812 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688624 688624 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729680 729680 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478384 478384 0 0.0
RAM 141476 141476 0 0.0
telink all-devices-app tl7218x FLASH 813028 813028 0 0.0
RAM 97196 97196 0 0.0
tlsr9118bdk40d FLASH 606480 606480 0 0.0
RAM 120152 120152 0 0.0
bridge-app tl7218x FLASH 731392 731392 0 0.0
RAM 95864 95864 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 851748 851748 0 0.0
RAM 44332 44332 0 0.0
tl7218x FLASH 843076 843076 0 0.0
RAM 99656 99656 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 731882 731882 0 0.0
RAM 55980 55980 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 795108 795108 0 0.0
RAM 75164 75164 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 731812 731812 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 614528 614528 0 0.0
RAM 118496 118496 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 841190 841194 4 0.0
RAM 97364 97364 0 0.0

Copilot AI review requested due to automatic review settings May 31, 2026 10:44
@woody-apple woody-apple force-pushed the case-no-teardown-in-flight branch from 23456c2 to 3fdad6f Compare May 31, 2026 10:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@woody-apple woody-apple force-pushed the case-no-teardown-in-flight branch from 3fdad6f to d428651 Compare May 31, 2026 17:44
Copilot AI review requested due to automatic review settings May 31, 2026 17:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Signed-off-by: Justin Wood <woody@apple.com>
@woody-apple woody-apple force-pushed the case-no-teardown-in-flight branch from 23456c2 to f8543c1 Compare May 31, 2026 18:03
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 31, 2026

PR #72255: Size comparison from 8a162c6 to f8543c1

Full report (35 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section 8a162c6 f8543c1 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094216 1094216 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105524 1105524 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593296 1593296 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057224 1057224 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896020 896020 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776944 776944 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789640 789640 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738772 738772 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718928 718928 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568690 568690 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596178 596178 0 0.0
RAM 205256 205256 0 0.0
efr32 lock-app BRD4187C FLASH 994060 994060 0 0.0
RAM 131288 131288 0 0.0
BRD4338a FLASH 798629 798629 0 0.0
RAM 243424 243424 0 0.0
window-app BRD4187C FLASH 1100480 1100480 0 0.0
RAM 130360 130360 0 0.0
esp32 all-clusters-app c3devkit DRAM 99716 99716 0 0.0
FLASH 1621508 1621508 0 0.0
IRAM 94776 94776 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834248 834248 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733916 1733916 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622708 1622708 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470196 1470196 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503332 1503332 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845080 845080 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783812 783812 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688624 688624 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729680 729680 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478384 478384 0 0.0
RAM 141476 141476 0 0.0
telink all-devices-app tl7218x FLASH 813028 813028 0 0.0
RAM 97196 97196 0 0.0
tlsr9118bdk40d FLASH 606480 606480 0 0.0
RAM 120152 120152 0 0.0
bridge-app tl7218x FLASH 731392 731392 0 0.0
RAM 95864 95864 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 851748 851748 0 0.0
RAM 44332 44332 0 0.0
tl7218x FLASH 843076 843076 0 0.0
RAM 99656 99656 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 731882 731882 0 0.0
RAM 55980 55980 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 795108 795108 0 0.0
RAM 75164 75164 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 731812 731812 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 614528 614528 0 0.0
RAM 118496 118496 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 841190 841194 4 0.0
RAM 97364 97364 0 0.0

@woody-apple
Copy link
Copy Markdown
Contributor Author

Withdrawing. The PR's own analysis establishes there is no use-after-free here (~OperationalSessionSetup teardown is safe), and the only in-tree ReleaseSession callers behave identically through the existing path, so the cooperative-release change is effectively inert. Closing; can revisit if a real retry/backoff churn case is demonstrated.

@github-project-automation github-project-automation Bot moved this from Todo to Done in [Platform] Darwin May 31, 2026
@woody-apple woody-apple reopened this May 31, 2026
@woody-apple
Copy link
Copy Markdown
Contributor Author

(FYI: This is Claude) Reopening — my earlier withdrawal rationale was incorrect. The claim that the change is "inert / callers behave identically" is false: both in-tree callers of ReleaseSession(peerId) (MTRDevice_Concrete.mm _triggerResubscribeWithReason ~:1222 and _deviceMayBeReachable ~:5257) fire while CASE is in-flight, and the guard changes observable behavior (it lets the in-flight attempt run its own retry cycle instead of tearing it down and re-kicking Sigma1 with reset backoff). The no-UAF observation stands, but whether suppressing forced re-establishment is the right call is a genuine design question — reopening so that can be decided on the merits rather than on the mistaken "no-op" premise.

@github-project-automation github-project-automation Bot moved this from Done to In Progress in [Platform] Darwin May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants