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 dynamic endpoint lifetime more similar to that of fixed endpoints. #9662

Conversation

bzbarsky-apple
Copy link
Contributor

Specific changes:

  1. Ensure that dynamic endpoints land in initializeEndpoint (via
    emberAfEndpointEnableDisable) like fixed ones do (via emAfCallInits).

  2. Ensure that clearing an dynamic endpoint properly disables it.
    This makes sure we call emberAfDeactivateClusterTick as needed and
    we can add other cleanup inside emberAfEndpointEnableDisable as it
    becomes useful.

  3. Move the emberAfPluginDescriptorServerInitCallback calls for
    dynamic endpoints to the one choke-point in
    emberAfEndpointEnableDisable. This also fixes a pre-existing issue
    where disabling a fixed endpoint would not correctly update the
    descriptor bits.

  4. In descriptor, check for enabled state before trying to actually
    touch the endpoint's data, not after we have tried to touch some of
    it.

Testing

I'm not sure how to test this. Right now nothing except bridge-app exercises dynamic endpoints, and I don't know how to go about testing that.

Specific changes:

1) Ensure that dynamic endpoints land in initializeEndpoint (via
   emberAfEndpointEnableDisable) like fixed ones do (via emAfCallInits).

2) Ensure that clearing an dynamic endpoint properly disables it.
   This makes sure we call emberAfDeactivateClusterTick as needed and
   we can add other cleanup inside emberAfEndpointEnableDisable as it
   becomes useful.

3) Move the emberAfPluginDescriptorServerInitCallback calls for
   dymanic endpoints to the one choke-point in
   emberAfEndpointEnableDisable.  This also fixes a pre-existing issue
   where disabling a fixed endpoint would not correctly update the
   descriptor bits.

4) In descriptor, check for enabled state before trying to actually
   touch the endpoint's data, not after we have tried to touch some of
   it.
@woody-apple
Copy link
Contributor

@saurabhst @msandstedt ?

@bzbarsky-apple
Copy link
Contributor Author

@bzbarsky-apple bzbarsky-apple merged commit 0a05d78 into project-chip:master Sep 20, 2021
@bzbarsky-apple bzbarsky-apple deleted the clearer-endpoint-init-shutdown branch September 20, 2021 16:01
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