bug: Sync is uninterruptable #2361
Labels
No labels
Abandoned
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Compliance
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 milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
continuwuation/continuwuity#2361
Loading…
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?
What is the bug?
The retry sleep in sync v2 is uninterruptable:
// Hang a few seconds so requests are not spammed// Stop hanging if new info arriveslet default = Duration::from_secs(30);let duration = cmp::min(body.body.timeout.unwrap_or(default), default);_ = tokio::time::timeout(duration, wake_receiver.changed()).await;// Retry returning databuild_sync_events(&services, &body).awaitThis means the server shutdown has to wait until that sleep completes, which artificially delays shutdown by up to 30 seconds. It should be able to be interrupted by
services.server.interrupt.notified, like the announcements loop:let mut i = interval(self.interval);i.set_missed_tick_behavior(MissedTickBehavior::Delay);i.reset_after(first_check_jitter);loop {tokio::select! {() = self.interrupt.notified() => break,_ = i.tick() => (),}Steps to reproduce
Server name and version
unstable.timedout.uk:8448 v26.9.1
a17a805293Additional context
No response