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

Shutdown subscription after exactly 30 minutes #876

Merged
merged 3 commits into from
Sep 4, 2024

Conversation

agners
Copy link
Collaborator

@agners agners commented Sep 4, 2024

Instead of relying on the progressively growing and random resubscribe interval simply check the time since the first re-subscription attempt.

The resubscribe interval is chosen at random, and even in the terminal state, a resubscription potentially happens below 30 minutes (in the final progression the resubscription time is chosen at random between 27 and 92 minutes). This means that in theory we shutdown the subscription much later than actually intended.

Instead of relying on the progressively growing and random resubscribe
interval simply check the time since the first re-subscription attempt.

The resubscribe interval is chosen at random, and even in the terminal
state, a resubscription potentially happens below 30 minutes (in the
final progression the resubscription time is chosen at random between
27 and 92 minutes). This means that in theory we shutdown the
subscription much later than actually intended.
@agners agners added the maintenance Code (quality) improvement or small enhancement which not a new feature label Sep 4, 2024
@agners
Copy link
Collaborator Author

agners commented Sep 4, 2024

It seems that the callback provided time is "made up", and doesn't reflect the actual resubscription time, e.g.:

2024-09-04 10:20:59.046 (Dummy-2) CHIP_PROGRESS [chip.native.DMG] Will try to resubscribe to 01:0000000000000001 at retry index 5 after 29988ms due to error src/protocols/secure_channel/CASESession.cpp:560: CHIP Error 0x00000032: Timeout
2024-09-04 10:20:59.047 (MainThread) INFO [matter_server.server.device_controller] <Node:1> Previous subscription failed with Error: 50, re-subscribing in 21192 ms...
...
2024-09-04 10:21:29.035 (Dummy-2) CHIP_PROGRESS [chip.native.DMG] OnResubscribeTimerCallback: ForceCASE = 1

(the actual resubscribe time was after ~29.9s, so the value provided by the SDK, not the Python callback)

This change just removes the Python callback provided time, it is useless currently.

@agners agners merged commit b3fd089 into main Sep 4, 2024
4 checks passed
@agners agners deleted the improve-node-offline-detection branch September 4, 2024 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Code (quality) improvement or small enhancement which not a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants