Merge lp:~hopem/nova/juno-sru-lp1459046 into lp:~ubuntu-server-dev/nova/juno

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 724
Proposed branch: lp:~hopem/nova/juno-sru-lp1459046
Merge into: lp:~ubuntu-server-dev/nova/juno
Diff against target: 126 lines (+106/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/add-support-for-syslog-connect-retries.patch (+98/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~hopem/nova/juno-sru-lp1459046
Reviewer Review Type Date Requested Status
Ubuntu Server Developers Pending
Review via email: mp+264871@code.launchpad.net
To post a comment you must log in.
lp:~hopem/nova/juno-sru-lp1459046 updated
725. By Edward Hope-Morley

adjust dch

726. By Edward Hope-Morley

rm name

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-07-06 11:06:22 +0000
3+++ debian/changelog 2015-07-15 16:42:02 +0000
4@@ -1,3 +1,10 @@
5+nova (1:2014.2.3-0ubuntu1.2) UNRELEASED; urgency=medium
6+
7+ * Add rsyslog retry support (LP: #1459046)
8+ - d/p/add-support-for-syslog-connect-retries.patch
9+
10+ -- Edward Hope-Morley <edward.hope-morley@canonical.com> Wed, 15 Jul 2015 18:10:02 +0200
11+
12 nova (1:2014.2.3-0ubuntu1.1) utopic; urgency=medium
13
14 * d/nova-compute.upstart: Fix (another) race between nova-compute
15
16=== added file 'debian/patches/add-support-for-syslog-connect-retries.patch'
17--- debian/patches/add-support-for-syslog-connect-retries.patch 1970-01-01 00:00:00 +0000
18+++ debian/patches/add-support-for-syslog-connect-retries.patch 2015-07-15 16:42:02 +0000
19@@ -0,0 +1,98 @@
20+From 11bbcad50acacb4a7c36c38cc486e64332022ac1 Mon Sep 17 00:00:00 2001
21+From: Edward Hope-Morley <edward.hope-morley@canonical.com>
22+Date: Thu, 18 Jun 2015 13:38:58 +0100
23+Subject: [PATCH] Add support for syslog connect retries
24+
25+If we have requested logging to syslog and syslog is
26+not yet ready we shoudl allow for retry attempts. This
27+patch provides a new option syslog-connect-retries to
28+allow for retries with a 5 second interval between
29+each retry.
30+
31+Closes-Bug: 1459046
32+
33+Change-Id: I3e5e892ce68a15f783a7d8a1a1fd56f6a53dd0ad
34+Co-authored-by: Liang Chen <liang.chen@canonical.com>
35+---
36+ nova/openstack/common/log.py | 49 ++++++++++++++++++++++++++++++++++----------
37+ 1 file changed, 38 insertions(+), 11 deletions(-)
38+
39+diff --git a/nova/openstack/common/log.py b/nova/openstack/common/log.py
40+index 5b8c685..36274c5 100644
41+--- a/nova/openstack/common/log.py
42++++ b/nova/openstack/common/log.py
43+@@ -35,6 +35,7 @@ import logging.handlers
44+ import os
45+ import socket
46+ import sys
47++import time
48+ import traceback
49+
50+ from oslo.config import cfg
51+@@ -103,6 +104,10 @@ logging_cli_opts = [
52+ help='Use syslog for logging. '
53+ 'Existing syslog format is DEPRECATED during I, '
54+ 'and will change in J to honor RFC5424.'),
55++ cfg.IntOpt('syslog-connect-retries',
56++ default=3,
57++ help='Number of attempts with a five second interval to retry '
58++ 'connecting to syslog. (if use-syslog=True)'),
59+ cfg.BoolOpt('use-syslog-rfc-format',
60+ # TODO(bogdando) remove or use True after existing
61+ # syslog format deprecation in J
62+@@ -544,19 +549,41 @@ def _setup_logging_from_conf(project, version):
63+ logger.setLevel(level_name)
64+
65+ if CONF.use_syslog:
66+- try:
67+- facility = _find_facility_from_conf()
68+- # TODO(bogdando) use the format provided by RFCSysLogHandler
69+- # after existing syslog format deprecation in J
70+- if CONF.use_syslog_rfc_format:
71+- syslog = RFCSysLogHandler(facility=facility)
72++ retries = CONF.syslog_connect_retries
73++ syslog_ready = False
74++ while True:
75++ try:
76++ facility = _find_facility_from_conf()
77++ # TODO(bogdando) use the format provided by RFCSysLogHandler
78++ # after existing syslog format deprecation in J
79++ if CONF.use_syslog_rfc_format:
80++ syslog = RFCSysLogHandler(facility=facility)
81++ else:
82++ syslog = logging.handlers.SysLogHandler(facility=facility)
83++ log_root.addHandler(syslog)
84++ syslog_ready = True
85++ except socket.error:
86++ if CONF.syslog_connect_retries <= 0:
87++ log_root.error(_('Connection to syslog failed and no '
88++ 'retry attempts requested'))
89++ break
90++
91++ if retries:
92++ log_root.info(_('Connection to syslog failed - '
93++ 'retrying in 5 seconds'))
94++ retries -= 1
95++ else:
96++ log_root.error(_('Connection to syslog failed and '
97++ 'max retry attempts reached'))
98++ break
99++
100++ time.sleep(5)
101+ else:
102+- syslog = logging.handlers.SysLogHandler(facility=facility)
103+- log_root.addHandler(syslog)
104+- except socket.error:
105+- log_root.error('Unable to add syslog handler. Verify that syslog'
106+- 'is running.')
107++ break
108+
109++ if not syslog_ready:
110++ log_root.error(_('Unable to add syslog handler. Verify that '
111++ 'syslog is running.'))
112+
113+ _loggers = {}
114+
115+--
116+1.9.1
117+
118
119=== modified file 'debian/patches/series'
120--- debian/patches/series 2014-12-05 19:59:54 +0000
121+++ debian/patches/series 2015-07-15 16:42:02 +0000
122@@ -5,3 +5,4 @@
123 skip-ubuntu-tests.patch
124 disable-websockify-tests.patch
125 neutron-floating-ip-list.patch
126+add-support-for-syslog-connect-retries.patch

Subscribers

People subscribed via source and target branches