-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 platform PlatformManager::PostEvent() return status #9573
Make platform PlatformManager::PostEvent() return status #9573
Conversation
#### Problem `void PlatformManager::PostEvent()` can fail on some platforms, but does not report this to callers. In the project-chip#9543 case, an intermediate layer unconditionally returned `CHIP_NO_ERROR`, and `Inet` code assumed it could actually test whether `PostEvent()` succeeded. Fixes project-chip#9543 _PacketBuffer leak_ #### Change overview Made `PlatformManager::PostEvent()` return `CHIP_ERROR`. Marked it `[[nodiscard]]` to catch all uses, and made callers propagate or at least log any error. #### Testing CI.
src/include/platform/internal/GenericConfigurationManagerImpl.cpp
Outdated
Show resolved
Hide resolved
src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp
Outdated
Show resolved
Hide resolved
Size increase report for "gn_qpg-example-build" from 2addf00
Full report output
|
Size increase report for "nrfconnect-example-build" from 2addf00
Full report output
|
Size increase report for "esp32-example-build" from 2addf00
Full report output
|
Kevin is OOO for another 2 weeks. @mrjerryjohns - should your comments be addressed by code changes in this PR or are you ok to merge and change as a followup to expedite changes going in? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the latest changes to now clearly provide a method that dies if it fails, vs a method that doesn't, Kevin's addressed my concerns.
Problem
void PlatformManager::PostEvent()
can fail on some platforms, but doesnot report this to callers.
In the #9543 case, an intermediate layer unconditionally returned
CHIP_NO_ERROR
, andInet
code assumed it could actually test whetherPostEvent()
succeeded.Fixes #9543 PacketBuffer leak
Change overview
Made
PlatformManager::PostEvent()
returnCHIP_ERROR
.Marked it
[[nodiscard]]
to catch all uses, and made callerspropagate or at least log any error.
Testing
CI.