fix(ghidra): keep and name a runtime directory that close could not remove
When removing Ghidra's private runtime directory failed, close_binary reported only a generic `provider-client` resource, and a later close, after the permission was restored, returned success while the directory and its contents remained. The client dropped its reference to the root before removing it, and PrivateRuntimeRoot cached the rejected removal. Keep each runtime or socket root until its removal succeeds, report a failure as a ProviderCleanupError naming the leftover paths, let PrivateRuntimeRoot retry a failed removal, and pass such typed cleanup failures through closeAnalysisClient instead of replacing them. Fixes #1190 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f36c10f9e8
commit
b79d379c25
@@ -86,12 +86,19 @@ export class PrivateRuntimeRoot {
|
||||
}
|
||||
}
|
||||
|
||||
/** Remove the runtime root; concurrent and repeated callers share cleanup. */
|
||||
/**
|
||||
* Remove the runtime root; concurrent callers share one attempt. A failed
|
||||
* attempt is not cached, so a later close retries the removal.
|
||||
*/
|
||||
close(): Promise<void> {
|
||||
this.#closePromise ??=
|
||||
this.#closePromise ??= (
|
||||
this.windowsRuntime === undefined
|
||||
? rm(this.path, { recursive: true, force: true })
|
||||
: Promise.resolve().then(() => this.windowsRuntime?.close());
|
||||
: Promise.resolve().then(() => this.windowsRuntime?.close())
|
||||
).catch((cause: unknown) => {
|
||||
this.#closePromise = undefined;
|
||||
throw cause;
|
||||
});
|
||||
return this.#closePromise;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user