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

feat(base): Increase the room_info_notable_update_sender capacity #4013

Conversation

Hywan
Copy link
Member

@Hywan Hywan commented Sep 17, 2024

This broadcast channel can easily be overflowed if more than 100 updates arrive
at the time. This patch extends the capacity to 2^16 - 1.

This patch also adds more logs to detect lagged on this channel from the room
list point of view.

@Hywan Hywan requested a review from a team as a code owner September 17, 2024 13:29
@Hywan Hywan requested review from jmartinesp and removed request for a team September 17, 2024 13:29
Copy link
Contributor

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! LGTM except for the typo 😉 .

Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding logs too.

(Should we remove the code that's commented out? Would be fairly easy to add it back later anyways.)

crates/matrix-sdk-base/src/client.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😝

crates/matrix-sdk-base/src/client.rs Outdated Show resolved Hide resolved
@Hywan Hywan force-pushed the fix-ui-room-list-detect-lag-from-roominfonotableupdate branch 3 times, most recently from fe00c61 to d3feae7 Compare September 17, 2024 13:43
@Hywan
Copy link
Member Author

Hywan commented Sep 17, 2024

I've removed the comments as suggested by @bnjbvr and I've used u16::MAX directly, without substrating 1.

Comment on lines 232 to 236
Err(RecvError::Closed) => {
error!("Cannot receive room info notable updates because the sender has been closed");
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hacktualley: if this stream has closed, then this infinite loop will iloop on this case, right? Maybe we should return at this point?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm adding a little break then. Good catch. It would have been caught previously, but not anymore.

This patch updates `merge_stream_and_receiver` to display an `error!`
when the room info receiver reads an error, like `Closed` or `Lagged`.
This is helpful when debugging.
This broadcast channel can easily be overflowed if more than 100 updates
arrive at the time. This patch extends the capacity to 2^16 - 1.
@Hywan Hywan force-pushed the fix-ui-room-list-detect-lag-from-roominfonotableupdate branch from d3feae7 to f00bbf8 Compare September 17, 2024 14:05
Copy link

codecov bot commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.

Project coverage is 84.24%. Comparing base (f576c72) to head (f00bbf8).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...s/matrix-sdk-ui/src/room_list_service/room_list.rs 0.00% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4013      +/-   ##
==========================================
- Coverage   84.27%   84.24%   -0.04%     
==========================================
  Files         266      266              
  Lines       28336    28343       +7     
==========================================
- Hits        23880    23877       -3     
- Misses       4456     4466      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Hywan Hywan merged commit 72febae into matrix-org:main Sep 17, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants