We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd6054e commit 2caa283Copy full SHA for 2caa283
crates/database/src/table_iteration.rs
@@ -252,6 +252,12 @@ impl<RT: Runtime> TableIterator<RT> {
252
253
let mut merged_page_docs = self.reload_revisions_at_snapshot_ts(merged_page);
254
while let Some((key, ts, doc)) = merged_page_docs.try_next().await? {
255
+ // The caller will likely consume the documents in a CPU-intensive loop,
256
+ // and `merged_page_docs.try_next().await` will often be Ready
257
+ // immediately, so it won't yield.
258
+ // Make sure we yield to not starve other tokio tasks.
259
+ tokio::task::consume_budget().await;
260
+
261
yield (key, ts, doc);
262
}
263
if matches!(page_end, CursorPosition::End) {
0 commit comments