whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: WHIMSY-96 Retry failed svn updates
Date Fri, 02 Jun 2017 16:54:26 GMT
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  891674d   WHIMSY-96 Retry failed svn updates
891674d is described below

commit 891674d13f7967321bdf507a7cafd11ba5222fef
Author: Sebb <sebb@apache.org>
AuthorDate: Fri Jun 2 17:54:25 2017 +0100

    WHIMSY-96 Retry failed svn updates
---
 Rakefile                   | 30 +++++++++++++++++++++++++++++-
 www/status/monitors/svn.rb | 16 ++++++++++++++++
 2 files changed, 45 insertions(+), 1 deletion(-)

diff --git a/Rakefile b/Rakefile
index 7190c96..af66c0a 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,4 +1,5 @@
 require 'rubygems/package_task'
+require 'open3'
 
 spec = eval(File.read('asf.gemspec'))
 Gem::PackageTask.new(spec) do |pkg|
@@ -77,7 +78,34 @@ namespace :svn do
           puts
           puts File.join(Dir.pwd, name)
           if Dir.exist? name
-            Dir.chdir(name) {system 'svn cleanup'; system 'svn up'}
+            Dir.chdir(name) {
+              system 'svn cleanup'
+              outerr = nil
+              # svn update can fail sometimes, so we retry
+              2.times do |i|
+                if i > 0
+                  PREFIX = '#!:' # must agree with monitors/svn.rb
+                  # log the failure - prefix tells monitor to ignore it
+                  puts "#{PREFIX} failed!"
+                  outerr.split("\n").each do |l|
+                    puts "#{PREFIX} #{l}"                    
+                  end
+                  n = 10
+                  puts "#{PREFIX} will retry in #{n} seconds"
+                  sleep n                    
+                end
+                begin
+                  outerr, status = Open3.capture2e('svn up')
+                  if status.success?
+                    break
+                  end
+                rescue => e
+                  outerr = e.inspect
+                  break
+                end
+              end
+              puts outerr # show what happened last
+            }
           else
             system 'svn', 'checkout', 
               "--depth=#{description['depth'] || 'infinity'}",
diff --git a/www/status/monitors/svn.rb b/www/status/monitors/svn.rb
index ffb6d34..d82282f 100644
--- a/www/status/monitors/svn.rb
+++ b/www/status/monitors/svn.rb
@@ -10,6 +10,11 @@ Updating '.':
 At revision 67610.
 
 /srv/svn/site-root
+Updating '.':
+U    index.html
+Updated to revision 1797393.
+
+/srv/svn/site-root
 A    site-root/extpaths.txt
  U   site-root
 Checked out revision 1797381.
@@ -18,6 +23,15 @@ Checked out revision 1797381.
 Updating '.':
 svn: E175002: Unexpected HTTP status 400 'Bad Request' on '/repos/private/!svn/rvr/76960/foundation/officers/personnel-duties'
 
+/x1/srv/svn/personnel-duties
+#!: failed!
+#!: Updating '.':
+#!: svn: E175002: Unexpected HTTP status 400 'Bad Request' on '/repos/private/!svn/rvr/76960/foundation/officers/personnel-duties'
+#!: will retry in 10 seconds
+Updating '.':
+svn: E175002: Unexpected HTTP status 400 'Bad Request' on '/repos/private/!svn/rvr/76960/foundation/officers/personnel-duties'
+Updated to revision 1797393.
+
 ---- cut here ---
 
 Output status level can be:
@@ -54,6 +68,8 @@ def Monitor.svn(previous_status)
 
     lines.reject! do |line| 
       line == "Updating '.':" or
+      # must agree with Rakefile/PREFIX
+      line.start_with?('#!: ') or
       line =~ /^(Checked out|Updated to|At) revision \d+\.$/
     end
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message