fix: do not double-report snapshotTasks after wrapAsyncAsSnapshot

This commit is contained in:
Sebastian Ullrich 2024-11-14 10:36:48 +01:00
parent 214093e6c4
commit d26dbe73d5
2 changed files with 10 additions and 2 deletions

View file

@ -423,7 +423,11 @@ def wrapAsyncAsSnapshot (act : Unit → CoreM Unit) (desc : String := by exact d
IO.FS.withIsolatedStreams (isolateStderr := stderrAsMessages.get (← getOptions)) do
let tid ← IO.getTID
-- reset trace state and message log so as not to report them twice
modify fun st => { st with messages := st.messages.markAllReported, traceState := { tid } }
modify fun st => { st with
messages := st.messages.markAllReported
traceState := { tid }
snapshotTasks := #[]
}
try
withTraceNode `Elab.async (fun _ => return desc) do
act ()

View file

@ -313,7 +313,11 @@ def wrapAsyncAsSnapshot (act : Unit → CommandElabM Unit)
IO.FS.withIsolatedStreams (isolateStderr := Core.stderrAsMessages.get (← getOptions)) do
let tid ← IO.getTID
-- reset trace state and message log so as not to report them twice
modify fun st => { st with messages := st.messages.markAllReported, traceState := { tid } }
modify fun st => { st with
messages := st.messages.markAllReported
traceState := { tid }
snapshotTasks := #[]
}
try
withTraceNode `Elab.async (fun _ => return desc) do
act ()