Skip to content

Commit a9b79a5

Browse files
authored
Disable checkpoint interruption (#236)
* Temporarily disable interrupting of checkpoints. * Add changeset. * Skip checkpoint interruption test.
1 parent a90fbe9 commit a9b79a5

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@powersync/service-core': patch
3+
---
4+
5+
Fix hanging sync connections due to checkpoint interruptions.

packages/service-core-tests/src/tests/register-sync-tests.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ bucket_definitions:
158158
expect(lines).toMatchSnapshot();
159159
});
160160

161-
test('sync interrupts low-priority buckets on new checkpoints', async () => {
161+
// Temporarily skipped - interruption disabled
162+
test.skip('sync interrupts low-priority buckets on new checkpoints', async () => {
162163
await using f = await factory();
163164

164165
const syncRules = await f.updateSyncRules({

packages/service-core/src/sync/sync.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,14 @@ async function* streamResponseInner(
180180
function markOperationsSent(operations: number) {
181181
syncedOperations += operations;
182182
tracker.addOperationsSynced(operations);
183-
maybeRaceForNewCheckpoint();
183+
// Disable interrupting checkpoints for now.
184+
// There is a bug with interrupting checkpoints where:
185+
// 1. User is in the middle of syncing a large batch of data (for example initial sync).
186+
// 2. A new checkpoint comes in, which interrupts the batch.
187+
// 3. However, the new checkpoint does not contain any new data for this connection, so nothing further is synced.
188+
// This then causes the client to wait indefinitely for the remaining data or checkpoint_complete message. That is
189+
// only resolved when a new checkpoint comes in that does have data for this connection, or the connection is restarted.
190+
// maybeRaceForNewCheckpoint();
184191
}
185192

186193
// This incrementally updates dataBuckets with each individual bucket position.

0 commit comments

Comments
 (0)