BBlack has submitted this change and it was merged.

Change subject: varnish: restart upload backends once a day
......................................................................


varnish: restart upload backends once a day

Automate varnish-be restarts in cache_upload in order to avoid prod
issues while we're debugging T145661.

Change-Id: If07089ac19059250ab5c3429d686fed33db17092
---
M modules/role/manifests/cache/upload.pp
A modules/varnish/templates/varnish-backend-restart.cron.erb
2 files changed, 13 insertions(+), 0 deletions(-)

Approvals:
  BBlack: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/role/manifests/cache/upload.pp 
b/modules/role/manifests/cache/upload.pp
index 767a87c..386065a 100644
--- a/modules/role/manifests/cache/upload.pp
+++ b/modules/role/manifests/cache/upload.pp
@@ -129,4 +129,16 @@
     ::varnish::logging::media { 'media':
         statsd_server => hiera('statsd'),
     }
+
+    # XXX: temporary, we need this to mitigate T145661
+    $be_restart_h = fqdn_rand(24)
+    $be_restart_m = fqdn_rand(60)
+
+    file { '/etc/cron.d/varnish-backend-restart':
+        mode    => '0444',
+        owner   => 'root',
+        group   => 'root',
+        content => template('varnish/varnish-backend-restart.cron.erb'),
+        require => File['/usr/local/sbin/varnish-backend-restart'],
+    }
 }
diff --git a/modules/varnish/templates/varnish-backend-restart.cron.erb 
b/modules/varnish/templates/varnish-backend-restart.cron.erb
new file mode 100644
index 0000000..bc88893
--- /dev/null
+++ b/modules/varnish/templates/varnish-backend-restart.cron.erb
@@ -0,0 +1 @@
+<%= @be_restart_m %> <%= @be_restart_h %> * * * root 
/usr/local/sbin/varnish-backend-restart > /dev/null

-- 
To view, visit https://gerrit.wikimedia.org/r/311142
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If07089ac19059250ab5c3429d686fed33db17092
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ema <e...@wikimedia.org>
Gerrit-Reviewer: BBlack <bbl...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to