Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport PR for 7015 #7486

Merged
merged 2 commits into from
Nov 24, 2022
Merged

Conversation

abhijat
Copy link
Contributor

@abhijat abhijat commented Nov 24, 2022

backport PR for #7015

The http client in cloud_roles::make_request was not closed when
exception is thrown. RAII might usually be a better fit for ensuring the
client is closed, but the client stop method returns a future which
cannot be returned from/blocked on in destructor.

This change introduces a helper modeled after ss::with_file to accept
and own an http client and close it after a user-supplied operation is
finished.

It also adds a helper to wrap making an http request with catching and
logging common http call errors.

(cherry picked from commit 024ba8e)
(cherry picked from commit dc5c9ef)

automated cherry pick failed in
redpanda-data#7015

adjusted the http imposter to bring in only the required part of the api
for the tests in backport.
@abhijat abhijat marked this pull request as ready for review November 24, 2022 10:05
@abhijat
Copy link
Contributor Author

abhijat commented Nov 24, 2022

failure https://buildkite.com/redpanda/redpanda/builds/19026#0184a894-f5bc-4e79-97e5-d124922af099



test_id:    rptest.tests.consumer_group_test.ConsumerGroupTest.test_dead_group_recovery.static_members=True
--
  | status:     FAIL
  | run time:   36.613 seconds
  |  
  |  
  | RpkException('command /var/lib/buildkite-agent/builds/buildkite-amd64-xfs-builders-i-08b617cabb280df44-1/redpanda/redpanda/vbuild/release/clang/dist/local/redpanda/bin/rpk group --brokers docker-rp-23:9092,docker-rp-8:9092,docker-rp-19:9092 describe test-gr-1 returned 1, output: all 1 DescribeGroups request failures, first error: broker replied that group test-gr-1 has broker coordinator 2, but did not reply with that broker in the broker list\n', '')
  | Traceback (most recent call last):
  | File "/usr/local/lib/python3.10/dist-packages/ducktape/tests/runner_client.py", line 135, in run
  | data = self.run_test()
  | File "/usr/local/lib/python3.10/dist-packages/ducktape/tests/runner_client.py", line 227, in run_test
  | return self.test_context.function(self.test)
  | File "/usr/local/lib/python3.10/dist-packages/ducktape/mark/_mark.py", line 476, in wrapper
  | return functools.partial(f, *args, **kwargs)(*w_args, **w_kwargs)
  | File "/root/tests/rptest/services/cluster.py", line 35, in wrapped
  | r = f(self, *args, **kwargs)
  | File "/root/tests/rptest/tests/consumer_group_test.py", line 361, in test_dead_group_recovery
  | wait_until(group_is_dead, 30, 2)
  | File "/usr/local/lib/python3.10/dist-packages/ducktape/utils/util.py", line 53, in wait_until
  | raise e
  | File "/usr/local/lib/python3.10/dist-packages/ducktape/utils/util.py", line 44, in wait_until
  | if condition():
  | File "/root/tests/rptest/tests/consumer_group_test.py", line 352, in group_is_dead
  | rpk_group = rpk.group_describe(group)
  | File "/root/tests/rptest/clients/rpk.py", line 470, in group_describe
  | rpk_group = try_describe_group(group)
  | File "/root/tests/rptest/clients/rpk.py", line 425, in try_describe_group
  | out = self._run_group(cmd)
  | File "/root/tests/rptest/clients/rpk.py", line 518, in _run_group
  | return self._execute(cmd, stdin=stdin, timeout=timeout)
  | File "/root/tests/rptest/clients/rpk.py", line 630, in _execute
  | raise RpkException(
  | rptest.clients.rpk.RpkException: RpkException<command /var/lib/buildkite-agent/builds/buildkite-amd64-xfs-builders-i-08b617cabb280df44-1/redpanda/redpanda/vbuild/release/clang/dist/local/redpanda/bin/rpk group --brokers docker-rp-23:9092,docker-rp-8:9092,docker-rp-19:9092 describe test-gr-1 returned 1, output: all 1 DescribeGroups request failures, first error: broker replied that group test-gr-1 has broker coordinator 2, but did not reply with that broker in the broker list
  | >


seems to be instance of #5079

@abhijat abhijat merged commit d05c6d6 into redpanda-data:v22.2.x Nov 24, 2022
@BenPope BenPope added this to the v22.2.8 milestone Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants