bug: New atomic state fetch does not appropriately throttle requests for events #2090
Labels
No labels
Abandoned
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/E2EE
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Matrix/T&S
Merge
Merge/Manual
Merge/Squash
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
bob the builder
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Depends on
#2097 feat: Server health tracking
continuwuation/continuwuity
Reference
continuwuation/continuwuity#2090
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When requesting events atomically to fill gaps in missing state before, continuwuity does not attempt to back off or prevent further requests for an event if an initial request fails. This can happen when all remote servers (for example) return a 403 M_FORBIDDEN on the state event:
pub(super) async fn fetch_and_handle_auth_events<Pdu>(.
There is no backoff in event fetching here, which means c10y will attempt to fetch an auth event 5 times as fast as possible, and then moves on. However, it will then do this dance again if it receives yet another event that references a bad event. This is particularly damaging during catchup.
The same failure can be observed for the atomic fallback for prev events,
pub(super) async fn fetch_prev_events<Pdu>(, however this is significantly less frequent as this is a fallback behaviour that is usually not reached due to
get_missing_events.After further investigation:
fetch_and_handle_auth_eventsis only called during the PDU upgrade processfetch_and_persist_event_authrather than continuing to attempt to fetch recursively if we encounter an event we cannot fetch, as the chances of a retry succeeding are also slim (UNLESS the error is a 429)does the old "event backoff" need to be stubbed back in here?
most likely, since
fetch_and_persist_event_authis slow. But also, it might just be worth aborting the entire fetch if we can't get a single event, because we can't upgrade the PDU without the entire auth chain. and like I said, subsequent retries are just as likely to fail anyway. Upgrading PDUs is retried when we receive another one referencing the failed one anywayFixing this will depend on #2097 (for the new backoff stuff)
gonna make this blocking because my reverse proxy is sustaining a request load of 100 requests per second just because I'm a backfill candidate in some rooms, and a trusted server, and this is an absurd waste of compute and network