From b2e863fd6f6d7c7d50e9ce35259d637fb025b2f3 Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Thu, 6 Dec 2018 09:35:39 +0000 Subject: [PATCH] autopkgtest: Publish AMQP messages persistently We want to ask the broker to write them out to disk, hoepfully mitigating against it crashing. --- britney2/policies/autopkgtest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py index a904c15..43fed24 100644 --- a/britney2/policies/autopkgtest.py +++ b/britney2/policies/autopkgtest.py @@ -952,7 +952,9 @@ class AutopkgtestPolicy(BasePolicy): params = json.dumps(params) if self.amqp_channel: - self.amqp_channel.basic_publish(amqp.Message(src + '\n' + params), routing_key=qname) + self.amqp_channel.basic_publish(amqp.Message(src + '\n' + params, + delivery_mode=2), # persistent + routing_key=qname) else: assert self.amqp_file with open(self.amqp_file, 'a') as f: