utils, db: qualify seastar::coroutine:: to avoid shadowing by utils::coroutine class

Inside namespace utils, unqualified coroutine:: resolves to the
utils::coroutine class (utils/coroutine.hh) rather than the
seastar::coroutine namespace. This causes build failures when
replica/database.hh is added to the precompiled header, because
utils/coroutine.hh becomes transitively visible in all TUs.

Qualify all coroutine:: references with seastar:: in affected files
under utils/ and db/.
This commit is contained in:
Yaniv Michael Kaul
2026-04-17 11:45:02 +03:00
parent 66618cd869
commit 28e59bae5a
8 changed files with 27 additions and 27 deletions

View File

@@ -2002,7 +2002,7 @@ future<gms::inet_address> resolve(const config_file::named_value<sstring>& addre
}
}
co_return coroutine::exception(std::move(ex));
co_return seastar::coroutine::exception(std::move(ex));
}
static std::vector<seastar::metrics::relabel_config> get_relable_from_yaml(const YAML::Node& yaml, const std::string& name) {

View File

@@ -566,7 +566,7 @@ public:
}
if (need_preempt() && i != _cache.end()) {
auto key = i->idx;
co_await coroutine::maybe_yield();
co_await seastar::coroutine::maybe_yield();
i = _cache.lower_bound(key);
}
}

View File

@@ -83,7 +83,7 @@ directories::directories(bool developer_mode)
future<> directories::create_and_verify(directories::set dir_set, recursive recursive) {
std::vector<file_lock> locks;
locks.reserve(dir_set.get_paths().size());
co_await coroutine::parallel_for_each(dir_set.get_paths(), [this, &locks, recursive] (fs::path path) -> future<> {
co_await seastar::coroutine::parallel_for_each(dir_set.get_paths(), [this, &locks, recursive] (fs::path path) -> future<> {
file_lock lock = co_await touch_and_lock(path);
locks.emplace_back(std::move(lock));
co_await disk_sanity(path, _developer_mode);
@@ -144,7 +144,7 @@ future<> directories::do_verify_owner_and_mode(fs::path path, recursive recurse,
co_return;
}
auto lister = directory_lister(path, lister::dir_entry_types::full(), do_verify_subpath, lister::show_hidden::no);
co_await with_closeable(std::move(lister), coroutine::lambda([&] (auto& lister) -> future<> {
co_await with_closeable(std::move(lister), seastar::coroutine::lambda([&] (auto& lister) -> future<> {
while (auto de = co_await lister.get()) {
co_await do_verify_owner_and_mode(path / de->name, recurse, level + 1, do_verify_subpath);
}
@@ -168,7 +168,7 @@ future<> directories::verify_owner_and_mode(fs::path path, recursive recursive)
future<> directories::verify_owner_and_mode_of_data_dir(directories::set dir_set) {
// verify data and index files in the first iteration and the other files in the second iteration.
for (auto verify_data_and_index_files : { true, false }) {
co_await coroutine::parallel_for_each(dir_set.get_paths(), [verify_data_and_index_files] (const auto &path) {
co_await seastar::coroutine::parallel_for_each(dir_set.get_paths(), [verify_data_and_index_files] (const auto &path) {
return do_verify_owner_and_mode(std::move(path), recursive::yes, 0, [verify_data_and_index_files] (const fs::path& dir, const directory_entry& de) {
auto path = dir / de.name;
component_type path_component_type;

View File

@@ -352,7 +352,7 @@ utils::gcp::storage::client::impl::send_with_retry(const std::string& path, cons
auto content = co_await util::read_entire_stream_contiguous(_in);
auto error_msg = get_gcp_error_message(std::string_view(content));
gcp_storage.debug("Got unexpected response status: {}, content: {}", rep._status, content);
co_await coroutine::return_exception_ptr(std::make_exception_ptr(httpd::unexpected_status_error(rep._status)));
co_await seastar::coroutine::return_exception_ptr(std::make_exception_ptr(httpd::unexpected_status_error(rep._status)));
}
std::exception_ptr eptr;
@@ -366,7 +366,7 @@ utils::gcp::storage::client::impl::send_with_retry(const std::string& path, cons
eptr = std::current_exception();
}
if (eptr) {
co_await coroutine::return_exception_ptr(std::move(eptr));
co_await seastar::coroutine::return_exception_ptr(std::move(eptr));
}
};
object_storage_retry_strategy retry_strategy(10,10ms,10000ms, as);

View File

@@ -84,7 +84,7 @@ future<std::optional<directory_entry>> directory_lister::get() {
_gen.emplace(_opened.experimental_list_directory());
}
if (!_gen) {
co_return coroutine::exception(std::make_exception_ptr(seastar::broken_pipe_exception()));
co_return seastar::coroutine::exception(std::make_exception_ptr(seastar::broken_pipe_exception()));
}
std::exception_ptr ex;
try {
@@ -114,7 +114,7 @@ future<std::optional<directory_entry>> directory_lister::get() {
_gen.reset();
if (ex) {
co_await _opened.close();
co_return coroutine::exception(std::move(ex));
co_return seastar::coroutine::exception(std::move(ex));
}
co_return std::nullopt;
}

View File

@@ -438,7 +438,7 @@ private:
break;
}
_reclaim(free_memory_threshold - memory::free_memory());
co_await coroutine::maybe_yield();
co_await seastar::coroutine::maybe_yield();
}
llogger.debug("background_reclaimer::main_loop: exit");
}

View File

@@ -136,7 +136,7 @@ public:
_map.erase(_map.begin());
}
if (++ret % evictions_per_yield == 0) {
co_await coroutine::maybe_yield();
co_await seastar::coroutine::maybe_yield();
}
}
co_return ret;

View File

@@ -340,7 +340,7 @@ http::experimental::client::reply_handler client::wrap_handler(http::request& re
should_retry = utils::http::retryable::yes;
co_await authorize(request);
}
co_await coroutine::return_exception_ptr(std::make_exception_ptr(
co_await seastar::coroutine::return_exception_ptr(std::make_exception_ptr(
aws::aws_exception(aws_error(possible_error->get_error_type(), possible_error->get_error_message().c_str(), should_retry))));
}
@@ -359,7 +359,7 @@ http::experimental::client::reply_handler client::wrap_handler(http::request& re
eptr = std::current_exception();
}
if (eptr) {
co_await coroutine::return_exception_ptr(std::make_exception_ptr(aws::aws_exception(aws_error::from_exception_ptr(eptr))));
co_await seastar::coroutine::return_exception_ptr(std::make_exception_ptr(aws::aws_exception(aws_error::from_exception_ptr(eptr))));
}
};
}
@@ -540,7 +540,7 @@ future<> client::put_object_tagging(sstring object_name, tag_set tagging, seasta
}
co_await output.close();
if (ex) {
co_await coroutine::return_exception_ptr(std::move(ex));
co_await seastar::coroutine::return_exception_ptr(std::move(ex));
}
});
co_await make_request(std::move(req), ignore_reply, http::reply::status_type::ok, as);
@@ -610,7 +610,7 @@ future<> client::put_object(sstring object_name, temporary_buffer<char> buf, sea
}
co_await out.close();
if (ex) {
co_await coroutine::return_exception_ptr(std::move(ex));
co_await seastar::coroutine::return_exception_ptr(std::move(ex));
}
});
co_await make_request(std::move(req), [len, start = s3_clock::now()] (group_client& gc, const auto& rep, auto&& in) {
@@ -636,7 +636,7 @@ future<> client::put_object(sstring object_name, ::memory_data_sink_buffers bufs
}
co_await out.close();
if (ex) {
co_await coroutine::return_exception_ptr(std::move(ex));
co_await seastar::coroutine::return_exception_ptr(std::move(ex));
}
});
co_await make_request(std::move(req), [len, start = s3_clock::now()] (group_client& gc, const auto& rep, auto&& in) {
@@ -886,7 +886,7 @@ future<> dump_multipart_upload_parts(output_stream<char> out, const utils::chunk
}
co_await out.close();
if (ex) {
co_await coroutine::return_exception_ptr(std::move(ex));
co_await seastar::coroutine::return_exception_ptr(std::move(ex));
}
}
@@ -902,7 +902,7 @@ future<> client::multipart_upload::start_upload() {
auto body = co_await util::read_entire_stream_contiguous(in);
_upload_id = parse_multipart_upload_id(body);
if (_upload_id.empty()) {
co_await coroutine::return_exception(std::runtime_error("cannot initiate upload"));
co_await seastar::coroutine::return_exception(std::runtime_error("cannot initiate upload"));
}
s3l.trace("created uploads for {} -> id = {}", _object_name, _upload_id);
}, http::reply::status_type::ok, _as);
@@ -937,7 +937,7 @@ future<> client::multipart_upload::upload_part(memory_data_sink_buffers bufs) {
}
co_await out.close();
if (ex) {
co_await coroutine::return_exception_ptr(std::move(ex));
co_await seastar::coroutine::return_exception_ptr(std::move(ex));
}
// note: At this point the buffers are sent, but the response is not yet
// received. However, claim is released and next part may start uploading
@@ -986,7 +986,7 @@ future<> client::multipart_upload::finalize_upload() {
unsigned parts_xml_len = prepare_multipart_upload_parts(_part_etags);
if (parts_xml_len == 0) {
co_await coroutine::return_exception(std::runtime_error("Failed to parse ETag list. Aborting multipart upload."));
co_await seastar::coroutine::return_exception(std::runtime_error("Failed to parse ETag list. Aborting multipart upload."));
}
s3l.trace("POST upload completion {} parts (upload id {})", _part_etags.size(), _upload_id);
@@ -1002,15 +1002,15 @@ future<> client::multipart_upload::finalize_upload() {
auto status_class = http::reply::classify_status(rep._status);
std::optional<aws::aws_error> possible_error = aws::aws_error::parse(co_await util::read_entire_stream_contiguous(payload));
if (possible_error) {
co_await coroutine::return_exception(aws::aws_exception(std::move(possible_error.value())));
co_await seastar::coroutine::return_exception(aws::aws_exception(std::move(possible_error.value())));
}
if (status_class != http::reply::status_class::informational && status_class != http::reply::status_class::success) {
co_await coroutine::return_exception(aws::aws_exception(aws::aws_error::from_http_code(rep._status)));
co_await seastar::coroutine::return_exception(aws::aws_exception(aws::aws_error::from_http_code(rep._status)));
}
if (rep._status != http::reply::status_type::ok) {
co_await coroutine::return_exception(httpd::unexpected_status_error(rep._status));
co_await seastar::coroutine::return_exception(httpd::unexpected_status_error(rep._status));
}
// If we reach this point it means the request succeeded. However, the body payload was already consumed, so no response handler was invoked. At
// this point it is ok since we are not interested in parsing this particular response
@@ -1444,7 +1444,7 @@ auto client::download_source::request_body() -> future<external_body> {
(void)_client->make_request(std::move(req), [this, &p] (group_client& gc, const http::reply& rep, input_stream<char>&& in_) mutable -> future<> {
s3l.trace("GET {} got the body ({} {} bytes)", _object_name, rep._status, rep.content_length);
if (rep._status != http::reply::status_type::partial_content && rep._status != http::reply::status_type::ok) {
co_await coroutine::return_exception(httpd::unexpected_status_error(rep._status));
co_await seastar::coroutine::return_exception(httpd::unexpected_status_error(rep._status));
}
auto in = std::move(in_);
@@ -1534,7 +1534,7 @@ class client::do_upload_file : private multipart_upload {
co_await output.close();
co_await input.close();
if (ex) {
co_await coroutine::return_exception_ptr(std::move(ex));
co_await seastar::coroutine::return_exception_ptr(std::move(ex));
}
}
@@ -1806,7 +1806,7 @@ future<> client::close() {
_creds_invalidation_timer.cancel();
_creds_update_timer.cancel();
}
co_await coroutine::parallel_for_each(_https, [] (auto& it) -> future<> {
co_await seastar::coroutine::parallel_for_each(_https, [] (auto& it) -> future<> {
co_await it.second.http.close();
});
}
@@ -1915,7 +1915,7 @@ future<std::optional<directory_entry>> client::bucket_lister::get() {
}
co_await close();
if (ex) {
co_return coroutine::exception(std::move(ex));
co_return seastar::coroutine::exception(std::move(ex));
}
co_return std::nullopt;
}