This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 9f2c53f7 Detect process startup failure
9f2c53f7 is described below
commit 9f2c53f776e7c2985afd393427458e6cf93bd6b1
Author: Sebb <[email protected]>
AuthorDate: Thu Oct 19 23:43:16 2023 +0100
Detect process startup failure
---
tools/site-scan.rb | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/site-scan.rb b/tools/site-scan.rb
index fcf95289..1d25590d 100755
--- a/tools/site-scan.rb
+++ b/tools/site-scan.rb
@@ -203,13 +203,18 @@ def exec_with_timeout(cmd, timeout)
Timeout.timeout(timeout) do
Process.waitpid(pid)
+ status = $?.success?
# close write ends so we can read from them
wout.close
werr.close
stdout = rout.readlines.join
stderr = rerr.readlines.join
- status = true
+ unless status
+ $stderr.puts "WARN: #{Time.now} failed scanning #{cmd[-1]} #{pid}"
+ stderr = 'Scanning failed'
+ end
+
end
rescue Timeout::Error