Disable full process scans on Linux
The env var DELTA_CALLING_PROCESS_QUERY_ALL re-enables this
last resort method. However usually this is just an expensive
scan which doesn't find the caller anyhow.
@@ -528,8 +528,20 @@ where
match info.find_sibling_in_refreshed_processes(my_pid, &extract_args) {
None => {
+ #[cfg(not(target_os = "linux"))]
+ let full_scan = true;
+
+ // The full scan is expensive on Linux and rarely successful, so disable it by default.
+ #[cfg(target_os = "linux")]
+ let full_scan = std::env::var("DELTA_CALLING_PROCESS_QUERY_ALL")
+ .map_or(false, |v| !["0", "false", "no"].iter().any(|&n| n == v));
+
+ if full_scan {
info.refresh_processes();
info.find_sibling_in_refreshed_processes(my_pid, &extract_args)
+ } else {
+ None
+ }
}
some => some,
}
