Unverified Commit 63cf7db1 authored by vercel-fleet-prod[bot]'s avatar vercel-fleet-prod[bot] Committed by GitHub

Preserve current GC roots with Papaya storage

Co-authored-by: 's avatarLuke Sandberg <210140+lukesandberg@users.noreply.github.com>
parent 86522a9c
......@@ -6382,12 +6382,6 @@ dependencies = [
"windows-sys 0.61.2",
]
[[package]]
name = "self_cell"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58bf37232d3bb9a2c4e641ca2a11d83b5062066f88df7fed36c28772046d65ba"
[[package]]
name = "semver"
version = "1.0.23"
......
......@@ -243,7 +243,9 @@ impl TurboTasksBackend {
.map(|ids| GcJob::ScanBatch(ids.to_vec()))
.collect::<Vec<_>>();
let (mut stats, mut result): (GcStats, GcPassResult) = scope_unbounded_with(
batches.into_iter().chain(aged_out.into_iter().map(GcJob::Collect)),
batches
.into_iter()
.chain(aged_out.into_iter().map(GcJob::Collect)),
Default::default,
|spawner, job, (stats, result): &mut (GcStats, GcPassResult)| {
if let Some(budget) = &budget
......
......@@ -476,7 +476,6 @@ impl Storage {
}
}
/// Read-only access to an already resident task. Returns `None` if the task isn't memory
/// resident. The closure runs while the task lock and Papaya protection are held, so it must be
/// cheap and must not re-enter this task or the map.
......@@ -491,16 +490,6 @@ impl Storage {
self.map.len()
}
#[doc(hidden)]
pub fn resident_persistent_task_count_for_testing(&self) -> usize {
self.map
.task_ids()
.into_iter()
.filter(|task_id| !task_id.is_transient())
.count()
}
}
/// Snapshot the IDs used to seed GC's unbounded work scope. Workers independently pin, lock,
/// and revalidate each task before applying the cheap collectibility filter.
pub fn gc_task_ids(&self) -> Vec<TaskId> {
......@@ -521,7 +510,7 @@ impl Storage {
let task_ids = self.gc_task_ids();
let mut roots = Vec::new();
self.map.for_each_locked(&task_ids, |task_id, task| {
if task.gc_is_root() {
if !task_id.is_transient() && task.gc_is_root() {
roots.push(task_id);
}
});
......@@ -1090,7 +1079,6 @@ mod tests {
fn snapshot_value(storage: &Storage, task_id: TaskId) -> Option<bool> {
storage.snapshots.get(&task_id).map(|value| value.is_some())
}
}
#[test]
fn unrelated_tasks_lock_independently() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment