project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.39k stars 1.98k forks source link

[ICD] Improvements to subscription resumption startup wait time #25439

Open jtung-apple opened 1 year ago

jtung-apple commented 1 year ago

This issue is for tracking improvement over https://github.com/project-chip/connectedhomeip/pull/25416

The naive implementation waits the largest min-interval of all persisted subscriptions, at the time the server becomes ready. There are a few improvements that can be made:

  1. Make use of server startup time as the basis for timers. This value currently resides in EventManagement, and could move to a more central location
  2. Waiting on the largest min-interval may cause too much waiting, if one value is particularly large. One way to handle this is to have a separate timer for each persisted subscription. But that both A) potentially runs into a timer resource issue, and B) having a low-powered device wake many times has energy use implications.
  3. There is discussion of making a coalescing timer abstraction over regular timers, that can take a fire/wait time value and either a "leeway" or some other specification how much earlier it should be allowed to fire. And with this mechanism, improvement 2 above could actually become feasible for low-powered devices.
bzbarsky-apple commented 1 year ago

This value currently resides in EventManagement, and could move to a more central location

The value lives in Server. It should just be passed in to the subscription resumption bits from there, no?

stale[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.