Skip to content

Commit 0dc8e48

Browse files
xemulavikivity
authored andcommitted
future: Move report_failed_future to internal namespace
It's in fact such, there's even doxygen marking. Also, while at it, collect all the overloads in one code block. Signed-off-by: Pavel Emelyanov <[email protected]>
1 parent 05a39bc commit 0dc8e48

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

include/seastar/core/future.hh

+7-6
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,6 @@ SEASTAR_MODULE_EXPORT_END
207207
/// \cond internal
208208
void engine_exit(std::exception_ptr eptr = {});
209209

210-
void report_failed_future(const std::exception_ptr& ex) noexcept;
211-
212-
void report_failed_future(const future_state_base& state) noexcept;
213-
214210
/// \endcond
215211

216212
/// \brief Exception type for broken promises
@@ -534,11 +530,16 @@ public:
534530
friend struct futurize;
535531
};
536532

533+
namespace internal {
534+
void report_failed_future(const std::exception_ptr& ex) noexcept;
535+
void report_failed_future(const future_state_base& state) noexcept;
537536
void report_failed_future(future_state_base::any&& state) noexcept;
537+
} // internal namespace
538+
538539

539540
inline void future_state_base::any::check_failure() noexcept {
540541
if (failed()) {
541-
report_failed_future(std::move(*this));
542+
internal::report_failed_future(std::move(*this));
542543
}
543544
}
544545

@@ -804,7 +805,7 @@ protected:
804805
// copy of ex and warn in the promise destructor.
805806
// Since there isn't any way for the user to clear
806807
// the exception, we issue the warning from here.
807-
report_failed_future(val);
808+
internal::report_failed_future(val);
808809
}
809810
}
810811

include/seastar/core/reactor.hh

+1-1
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ private:
660660
friend class scheduling_group;
661661
friend void internal::add_to_flush_poller(output_stream<char>& os) noexcept;
662662
friend void seastar::internal::increase_thrown_exceptions_counter() noexcept;
663-
friend void report_failed_future(const std::exception_ptr& eptr) noexcept;
663+
friend void internal::report_failed_future(const std::exception_ptr& eptr) noexcept;
664664
metrics::metric_groups _metric_groups;
665665
friend future<scheduling_group> create_scheduling_group(sstring name, sstring shortname, float shares) noexcept;
666666
friend future<> seastar::destroy_scheduling_group(scheduling_group) noexcept;

src/core/future.cc

+4
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ void future_state_base::rethrow_exception() const& {
225225
std::rethrow_exception(_u.ex);
226226
}
227227

228+
namespace internal {
229+
228230
void report_failed_future(const std::exception_ptr& eptr) noexcept {
229231
++engine()._abandoned_failed_futures;
230232
seastar_logger.warn("Exceptional future ignored: {}, backtrace: {}", eptr, current_backtrace());
@@ -238,6 +240,8 @@ void report_failed_future(future_state_base::any&& state) noexcept {
238240
report_failed_future(std::move(state).take_exception());
239241
}
240242

243+
} // internal namespace
244+
241245
void reactor::test::with_allow_abandoned_failed_futures(unsigned count, noncopyable_function<void ()> func) {
242246
auto before = engine()._abandoned_failed_futures;
243247
auto old_level = seastar_logger.level();

0 commit comments

Comments
 (0)