-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Python] fixed subscription crash #32257
[Python] fixed subscription crash #32257
Conversation
@tianfeng-yang I would suggest to use ShutdownSubscriptions from https://github.com/project-chip/connectedhomeip/blob/master/src/app/InteractionModelEngine.cpp#L296, and remove abort API. and leave the below unchanged.
|
Changing the API like this is a bit extensive, and I can't confirm whether it will cause a chain reaction. |
1de5de0
to
a629204
Compare
PR #32257: Size comparison from a629204 to e10817e Full report (20 builds for cc13x4_26x4, cc32xx, nrfconnect, nxp, qpg, stm32, tizen)
|
PR #32257: Size comparison from a629204 to d5f2d56 Full report (88 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
NOTE on old PR staleness review: this PR seems to be under active development and could use some reviews. |
This reverts commit dcb4444.
This reimplements project-chip#32257 without reformatting Python files.
Fixed #32310
ReadClient
life cycle isOnDone
. IfOnError
happend,OnDone
will eventually be executed. In the existing Python code,delete it
is executed inOnDone
. At this time,pCallback
andpReadClient
(moved frompychip_ReadClient_Read
) have both been deleted. , After that, if the python application executesSubscriptionTransaction.Shutdown()
ordelete
,pychip_ReadClient_Abort
will be executed, which will causepCallback
to be deleted again, causing the application to crash. Therefore, when callingShuddown()
ordelete
on the python side, you need to determine whetherOnError
happend. IfOnError
happend, you do not need to callpychip_ReadClient_Abort
again. If not, it is a normal delete behavior on the application side.ReadClient
also describes that after deletingReadClient
,OnDone
will not be executed, so we can directly deleteReadClient
in the callback ofOnDone
(the life cycle ofReadClient
has ended), so that there is no need to move the memory ofpReadClient
toReadClientCallback
inpychip_ReadClient_Read
.@notes: There is no problem moving
ReadClient
topCallback
here, butWriteClientCallback
is also not moved, just for consistency reasons.Follow the advice
The following two points are split into PR #32308
chip-tool
GetSubscriptionTimeoutMs
interface to check if the subscription is alive.