Merge ~paelzer/ubuntu/+source/rabbitmq-server:lp-1988283-fix-mnesia-error-JAMMY into ubuntu/+source/rabbitmq-server:ubuntu/jammy-devel

Proposed by Christian Ehrhardt 
Status: Approved
Approved by: git-ubuntu bot
Approved revision: not available
Proposed branch: ~paelzer/ubuntu/+source/rabbitmq-server:lp-1988283-fix-mnesia-error-JAMMY
Merge into: ubuntu/+source/rabbitmq-server:ubuntu/jammy-devel
Diff against target: 100 lines (+67/-1)
4 files modified
debian/changelog (+7/-0)
debian/control (+2/-1)
debian/patches/lp1988283-Handle-case-where-mnesia-table_info-2-returns-undefi.patch (+57/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
git-ubuntu bot Approve
Paride Legovini (community) Approve
Canonical Server Reporter Pending
Review via email: mp+429624@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Revision history for this message
Paride Legovini (paride) wrote :

I would squash the two d/changelog commits; for the rest the patch itself, headers and other packaging changes all LGTM. The package built fine in the PPA.

One nit on the patch file: the

  From: =?UTF-8?...

thing is a bit ugly and I think nothing is going to parse it.

Approving but the Kinetic fix [1] should land first.

[1] https://code.launchpad.net/~paelzer/ubuntu/+source/rabbitmq-server/+git/rabbitmq-server/+merge/429625

review: Approve
Revision history for this message
git-ubuntu bot (git-ubuntu-bot) wrote :

Approvers: paelzer, paride
Uploaders: paelzer, paride
MP auto-approved

review: Approve

Unmerged commits

8713f84... by Christian Ehrhardt 

update-maintainer

Signed-off-by: Christian Ehrhardt <email address hidden>

fc6b2c9... by Christian Ehrhardt 

changelog: 3.9.13-1ubuntu0.1 as SRU to fix (LP: #1988283)

Signed-off-by: Christian Ehrhardt <email address hidden>

7f0eaa0... by Christian Ehrhardt 

changelog: 3.9.13-1ubuntu1 to fix (LP: #1988283)

Signed-off-by: Christian Ehrhardt <email address hidden>

1c86f04... by Christian Ehrhardt 

d/p/lp1988283-Handle-case-where-mnesia-table_info-2-returns-undefi.patch: fix bug that crashes the prometheus_mnesia collector (LP: #1988283)

Signed-off-by: Christian Ehrhardt <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index c53574d..e059bec 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+rabbitmq-server (3.9.13-1ubuntu0.1) jammy; urgency=medium
7+
8+ * d/p/lp1988283-Handle-case-where-mnesia-table_info-2-returns-undefi.patch:
9+ fix bug that crashes the prometheus_mnesia collector (LP: #1988283)
10+
11+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Thu, 08 Sep 2022 09:32:30 +0200
12+
13 rabbitmq-server (3.9.13-1) unstable; urgency=medium
14
15 * New upstream release.
16diff --git a/debian/control b/debian/control
17index 001af0e..bdd2c79 100644
18--- a/debian/control
19+++ b/debian/control
20@@ -1,7 +1,8 @@
21 Source: rabbitmq-server
22 Section: net
23 Priority: optional
24-Maintainer: Debian OpenStack <team+openstack@tracker.debian.org>
25+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
26+XSBC-Original-Maintainer: Debian OpenStack <team+openstack@tracker.debian.org>
27 Uploaders:
28 James Page <james.page@ubuntu.com>,
29 Thomas Goirand <zigo@debian.org>,
30diff --git a/debian/patches/lp1988283-Handle-case-where-mnesia-table_info-2-returns-undefi.patch b/debian/patches/lp1988283-Handle-case-where-mnesia-table_info-2-returns-undefi.patch
31new file mode 100644
32index 0000000..ca1aa10
33--- /dev/null
34+++ b/debian/patches/lp1988283-Handle-case-where-mnesia-table_info-2-returns-undefi.patch
35@@ -0,0 +1,57 @@
36+From ffe2bf711659f5ee11970b8a60f7f0f72fc68770 Mon Sep 17 00:00:00 2001
37+From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= <lhoguin@vmware.com>
38+Date: Wed, 30 Mar 2022 09:10:00 +0200
39+Subject: [PATCH] Handle case where mnesia:table_info/2 returns undefined
40+ (#140)
41+
42+Origin: upstream, https://github.com/deadtrickster/prometheus.erl/commit/ffe2bf711659f5ee11970b8a60f7f0f72fc68770
43+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1988283
44+Applied-Upstream: 4.8.2 (prometheur.erl) 3.9.15 (rabbitmq)
45+Last-Update: 2022-09-08
46+
47+---
48+ .../mnesia/prometheus_mnesia_collector.erl | 16 +++++++++++++---
49+ 1 file changed, 13 insertions(+), 3 deletions(-)
50+
51+diff --git a/deps/prometheus/src/collectors/mnesia/prometheus_mnesia_collector.erl b/deps/prometheus/src/collectors/mnesia/prometheus_mnesia_collector.erl
52+index ef2ce18..811d483 100644
53+--- a/deps/prometheus/src/collectors/mnesia/prometheus_mnesia_collector.erl
54++++ b/deps/prometheus/src/collectors/mnesia/prometheus_mnesia_collector.erl
55+@@ -196,7 +196,7 @@ metric_enabled(Name, Metrics) ->
56+ get_memory_usage() ->
57+ WordSize = erlang:system_info(wordsize),
58+ Calculator = fun(Tab, Sum) ->
59+- mnesia:table_info(Tab, memory) + Sum
60++ table_info(Tab, memory) + Sum
61+ end,
62+ lists:foldl(Calculator, 0, mnesia:system_info(tables)) * WordSize.
63+
64+@@ -204,13 +204,23 @@ get_tablewise_memory_usage() ->
65+ WordSize = erlang:system_info(wordsize),
66+ Calculator =
67+ fun(Tab, Acc) ->
68+- [{[{table, Tab}], mnesia:table_info(Tab, memory) * WordSize} | Acc]
69++ [{[{table, Tab}], table_info(Tab, memory) * WordSize} | Acc]
70+ end,
71+ lists:foldl(Calculator, [], mnesia:system_info(tables)).
72+
73+ get_tablewise_size() ->
74+ Calculator =
75+ fun(Tab, Acc) ->
76+- [{[{table, Tab}], mnesia:table_info(Tab, size)} | Acc]
77++ [{[{table, Tab}], table_info(Tab, size)} | Acc]
78+ end,
79+ lists:foldl(Calculator, [], mnesia:system_info(tables)).
80++
81++%% mnesia:table_info/2 may return 'undefined' when the table should
82++%% be loaded on the local node but hasn't been loaded yet.
83++%%
84++%% https://github.com/erlang/otp/issues/5830
85++table_info(Tab, Item) ->
86++ case mnesia:table_info(Tab, Item) of
87++ undefined -> 0;
88++ Val -> Val
89++ end.
90+--
91+2.37.3
92+
93diff --git a/debian/patches/series b/debian/patches/series
94index fbc189a..7d43a61 100644
95--- a/debian/patches/series
96+++ b/debian/patches/series
97@@ -1,2 +1,3 @@
98 lets-use-python3-not-python-binary.patch
99 rabbitmq-dist.mk.patch
100+lp1988283-Handle-case-where-mnesia-table_info-2-returns-undefi.patch

Subscribers

People subscribed via source and target branches