Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@agners
Copy link
Contributor

@agners agners commented Sep 3, 2024

When the co-routine GetConnectedDevice() gets cancelled, the asyncio.wait_for() call will cancel the future we are waiting for. However, the SDK still calls the _DeviceAvailableCallback with an error (CHIP Error 0x00000074: The operation has been cancelled). But at this point we can't set the future result as the co-routine is already cancelled.

Simply check the future state before setting the result.

When the co-routine GetConnectedDevice() gets cancelled, the wait_for
call will cancel the future we are waiting for. However, the SDK still
calls the _DeviceAvailableCallback with an error (CHIP Error 0x00000074:
The operation has been cancelled). However, we can't set the future
result at this point as the co-routine is already cancelled.

Simply check the future state before setting the result.
@semanticdiff-com
Copy link

semanticdiff-com bot commented Sep 3, 2024

Review changes with SemanticDiff.

Analyzed 1 of 1 files.

Filename Status
✔️ src/controller/python/chip/ChipDeviceCtrl.py Analyzed

@github-actions
Copy link

github-actions bot commented Sep 3, 2024

PR #35380: Size comparison from 5dd517c to 32c5058

Full report (32 builds for bl602, bl702, bl702l, esp32, linux, nrfconnect, stm32, tizen)
platform target config section 5dd517c 32c5058 change % change
bl602 lighting-app bl602 FLASH 1279092 1279092 0 0.0
RAM 95880 95880 0 0.0
bl602+mfd FLASH 1293202 1293202 0 0.0
RAM 96024 96024 0 0.0
bl602+rpc FLASH 1318056 1318056 0 0.0
RAM 104304 104304 0 0.0
bl702 lighting-app bl702 FLASH 944678 944678 0 0.0
RAM 15209 15209 0 0.0
bl702+mfd FLASH 947078 947078 0 0.0
RAM 15353 15353 0 0.0
bl702+rpc FLASH 1039734 1039734 0 0.0
RAM 24221 24221 0 0.0
bl706-eth FLASH 647494 647494 0 0.0
RAM 25305 25305 0 0.0
bl706-wifi FLASH 894908 894908 0 0.0
RAM 14525 14525 0 0.0
bl702l lighting-app bl702l FLASH 961082 961082 0 0.0
RAM 16868 16868 0 0.0
bl702l+mfd FLASH 963704 963704 0 0.0
RAM 17012 17012 0 0.0
esp32 all-clusters-app c3devkit DRAM 94200 94200 0 0.0
FLASH 1539894 1539894 0 0.0
IRAM 82538 82538 0 0.0
m5stack DRAM 115136 115136 0 0.0
FLASH 1550502 1550502 0 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4624 4624 0 0.0
FLASH 2763665 2763665 0 0.0
RAM 128536 128536 0 0.0
all-clusters-app debug unknown 5408 5408 0 0.0
FLASH 6076348 6076348 0 0.0
RAM 510408 510408 0 0.0
all-clusters-minimal-app debug unknown 5304 5304 0 0.0
FLASH 5401164 5401164 0 0.0
RAM 240248 240248 0 0.0
bridge-app debug unknown 5288 5288 0 0.0
FLASH 4732250 4732250 0 0.0
RAM 217368 217368 0 0.0
chip-tool debug unknown 5832 5832 0 0.0
FLASH 12650916 12650916 0 0.0
RAM 558354 558354 0 0.0
fabric-admin debug unknown 5664 5664 0 0.0
FLASH 10949697 10949697 0 0.0
RAM 557066 557066 0 0.0
fabric-bridge-app debug unknown 4520 4520 0 0.0
FLASH 4555270 4555270 0 0.0
RAM 204016 204016 0 0.0
lighting-app debug+rpc+ui unknown 5936 5936 0 0.0
FLASH 5682561 5682561 0 0.0
RAM 228056 228056 0 0.0
lock-app debug unknown 5224 5224 0 0.0
FLASH 4787074 4787074 0 0.0
RAM 203768 203768 0 0.0
ota-provider-app debug unknown 4600 4600 0 0.0
FLASH 4426612 4426612 0 0.0
RAM 197752 197752 0 0.0
ota-requestor-app debug unknown 4536 4536 0 0.0
FLASH 4565198 4565198 0 0.0
RAM 202288 202288 0 0.0
shell debug unknown 4176 4176 0 0.0
FLASH 3103469 3103469 0 0.0
RAM 159040 159040 0 0.0
tv-app debug unknown 5504 5504 0 0.0
FLASH 6011589 6011589 0 0.0
RAM 583192 583192 0 0.0
tv-casting-app debug unknown 5168 5168 0 0.0
FLASH 10854957 10854957 0 0.0
RAM 645768 645768 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 915096 915096 0 0.0
RAM 142219 142219 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 886400 886400 0 0.0
RAM 140358 140358 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 846364 846364 0 0.0
RAM 141038 141038 0 0.0
stm32 light STM32WB5MM-DK FLASH 482744 482744 0 0.0
RAM 144716 144716 0 0.0
tizen all-clusters-app arm unknown 4848 4848 0 0.0
FLASH 1723564 1723564 0 0.0
RAM 89380 89380 0 0.0
chip-tool-ubsan arm unknown 10272 10272 0 0.0
FLASH 1751109 1751109 0 0.0
RAM 7601308 7601308 0 0.0

@mergify mergify bot merged commit ed3403d into master Sep 4, 2024
@mergify mergify bot deleted the avoid-invalid-state-error-on-cancel branch September 4, 2024 12:49
shgutte pushed a commit to shgutte/connectedhomeip that referenced this pull request Sep 10, 2024
When the co-routine GetConnectedDevice() gets cancelled, the wait_for
call will cancel the future we are waiting for. However, the SDK still
calls the _DeviceAvailableCallback with an error (CHIP Error 0x00000074:
The operation has been cancelled). However, we can't set the future
result at this point as the co-routine is already cancelled.

Simply check the future state before setting the result.
agners added a commit to home-assistant-libs/chip-wheels that referenced this pull request Sep 17, 2024
This adds Attribute cache update improvements and some other minor fixes
from the master branch to our 1.3 branch.

Specifically, this integrates changes from the following PRs
- project-chip/connectedhomeip#35380
- project-chip/connectedhomeip#34833
- project-chip/connectedhomeip#35557
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