Skip to content

Commit 0b7a03e

Browse files
authored
fix missing stored lag reference in OSS consumers (#329)
1 parent ed43d65 commit 0b7a03e

File tree

5 files changed

+35
-3
lines changed

5 files changed

+35
-3
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Karafka Web changelog
22

3+
## 0.9.1 (2024-05-03)
4+
- [Fix] OSS `lag_stored` for not-subscribed consumers causes Web UI to crash.
5+
36
## 0.9.0 (2024-04-26)
47
- **[Breaking]** Drop Ruby `2.7` support.
58
- **[Feature]** Provide ability to stop and quiet running consumers (Pro).

Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
karafka-web (0.9.0)
4+
karafka-web (0.9.1)
55
erubi (~> 1.4)
66
karafka (>= 2.4.0, < 2.5.0)
77
karafka-core (>= 2.4.0, < 2.5.0)

lib/karafka/web/ui/views/consumers/_consumer.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@
3535
</td>
3636

3737
<td>
38-
<%= process.lag_stored %>
38+
<%= process.lag_hybrid %>
3939
</td>
4040
</tr>

lib/karafka/web/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
module Karafka
44
module Web
55
# Current gem version
6-
VERSION = '0.9.0'
6+
VERSION = '0.9.1'
77
end
88
end

spec/lib/karafka/web/ui/controllers/consumers_controller_spec.rb

+29
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,35 @@
5252
end
5353
end
5454

55+
context 'when there is an active consumer but without any partitions assigned yet' do
56+
before do
57+
topics_config.consumers.states = states_topic
58+
topics_config.consumers.reports = reports_topic
59+
60+
report = Fixtures.consumers_reports_json
61+
scope = report[:consumer_groups][:example_app6_app][:subscription_groups][:c4ca4238a0b9_0]
62+
scope[:topics].clear
63+
64+
produce(states_topic, Fixtures.consumers_states_file)
65+
produce(reports_topic, report.to_json)
66+
67+
get 'consumers'
68+
end
69+
70+
it do
71+
expect(response).to be_ok
72+
expect(body).not_to include('partitions: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9')
73+
expect(body).to include(support_message)
74+
expect(body).not_to include(breadcrumbs)
75+
expect(body).not_to include(no_processes)
76+
expect(body).not_to include(pagination)
77+
expect(body).to include('246 MB')
78+
expect(body).to include('shinra:1:1')
79+
expect(body).to include('/consumers/shinra:1:1/subscriptions')
80+
expect(body).to include('2690818651.82293')
81+
end
82+
end
83+
5584
context 'when there are active consumers with many partitions assigned' do
5685
before do
5786
topics_config.consumers.states = states_topic

0 commit comments

Comments
 (0)