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

Fix management of the mNumReportsInFlight count in reporting engine. (#24093) #24114

Conversation

bzbarsky-apple
Copy link
Contributor

@bzbarsky-apple bzbarsky-apple commented Dec 16, 2022

If a ReadHandler failed out of SendReportData (e.g. because the session it's on
had been marked as defunct), we would increment mNumReportsInFlight and never
decrement it. After this happened CHIP_IM_MAX_REPORTS_IN_FLIGHT times (4 by
default), we would stop being able to send out any more data reports.

This situation is pretty easy to trigger as follows:

  1. Use chip-tool to commission a device with node id 17.
  2. Start chip-tool interactive mode.
  3. Run the following commands in interactive mode:
    onoff subscribe on-off 0 60 17 1 --keepSubscriptions true
    onoff subscribe on-off 0 60 17 1 --keepSubscriptions true
    onoff subscribe on-off 0 60 17 1 --keepSubscriptions true
    onoff subscribe on-off 0 60 17 1 --keepSubscriptions true
    onoff subscribe on-off 0 2 17 1 --keepSubscriptions true
    
  4. quit interactive mode (Ctrl-C or quit() command).
  5. Wait 60 seconds for all the subscriptions to error out.

After this the device will no longer respond with data reports to any
read or subscribe requests.

Includes:

Fixes #24115

bzbarsky-apple and others added 3 commits December 16, 2022 13:31
…roject-chip#24093)

If a ReadHandler failed out of SendReportData (e.g. because the session it's on
had been marked as defunct), we would increment mNumReportsInFlight and never
decrement it.  After this happened CHIP_IM_MAX_REPORTS_IN_FLIGHT times (4 by
default), we would stop being able to send out any more data reports.

This situation is pretty easy to trigger as follows:

1. Use chip-tool to commission a device with node id 17.
2. Start chip-tool interactive mode.
3. Run the following commands in interactive mode:

   onoff subscribe on-off 0 60 17 1 --keepSubscriptions true
   onoff subscribe on-off 0 60 17 1 --keepSubscriptions true
   onoff subscribe on-off 0 60 17 1 --keepSubscriptions true
   onoff subscribe on-off 0 60 17 1 --keepSubscriptions true
   onoff subscribe on-off 0 2 17 1 --keepSubscriptions true

4. quit interactive mode (Ctrl-C or quit() command).
5. Wait 60 seconds for all the subscriptions to error out.

After this the device will no longer respond with data reports to any
read or subscribe requests.
@woody-apple woody-apple merged commit 3c1d8cf into project-chip:v1.0-branch Dec 16, 2022
@bzbarsky-apple bzbarsky-apple deleted the 1.0-cherry-pick-readhandler-errors branch December 16, 2022 19:59
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.

[BUG] [1.0 branch] Reporting engine can get into a state where it never sends data reports
3 participants