From 0c9251aefa8519d92c53df1902c2bad441343e17 Mon Sep 17 00:00:00 2001 From: CyrusNajmabadi Date: Tue, 2 May 2017 21:12:44 -0700 Subject: [PATCH] Actual flushing of data is non-cancellable. --- .../SQLite/SQLitePersistentStorage_WriteBatching.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_WriteBatching.cs b/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_WriteBatching.cs index 867448b9904..578a1784cba 100644 --- a/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_WriteBatching.cs +++ b/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_WriteBatching.cs @@ -112,9 +112,13 @@ async Task GetWriteTaskAsync() // We're currently under a lock, so tell the continuation to run // *asynchronously* so that the TPL does not try to execute it inline // with this thread. + // + // Note: this flushing is not cancellable. We've already removed the + // writes from the write queue. If we were not to write them out we + // would be losing data. var nextTask = existingWriteTask.ContinueWith( _ => ProcessWriteQueue(connection, writesToProcess), - cancellationToken, + CancellationToken.None, TaskContinuationOptions.RunContinuationsAsynchronously, TaskScheduler.Default); -- GitLab