bug: Sync is uninterruptable #2361

Closed
opened 2026-10-13 18:08:26 +00:00 by nex · 0 comments
Owner

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 arrives
let 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 data
build_sync_events(&services, &body).await

This 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

  1. Start a sync request
  2. Send continuwuity a SIGTERM
  3. Wait a while

Server name and version

unstable.timedout.uk:8448 v26.9.1 a17a805293

Additional context

No response

### What is the bug? The retry sleep in sync v2 is uninterruptable: https://forgejo.ellis.link/continuwuation/continuwuity/src/commit/a17a8052936837b2c64054468288c9c6dc629119/src/api/client/sync/v3/mod.rs#L216-L223 This 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: https://forgejo.ellis.link/continuwuation/continuwuity/src/commit/a17a8052936837b2c64054468288c9c6dc629119/src/service/announcements/mod.rs#L107-L114 ### Steps to reproduce 1. Start a sync request 2. Send continuwuity a SIGTERM 3. Wait a while ### Server name and version unstable.timedout.uk:8448 v26.9.1 a17a8052936837b2c64054468288c9c6dc629119 ### Additional context _No response_
nex closed this issue 2026-11-17 10:06:32 +00:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
continuwuation/continuwuity#2361
No description provided.