]> git.pld-linux.org Git - packages/ceph.git/blob - ceph-libfmt.patch
- more libfmt fixes (WIP)
[packages/ceph.git] / ceph-libfmt.patch
1 --- ceph-17.2.3/src/seastar/src/core/exception_hacks.cc.orig    2021-12-19 23:02:10.000000000 +0100
2 +++ ceph-17.2.3/src/seastar/src/core/exception_hacks.cc 2022-09-04 18:05:18.578088101 +0200
3 @@ -98,7 +98,7 @@ void log_exception_trace() noexcept {
4      static thread_local bool nested = false;
5      if (!nested && exception_logger.is_enabled(log_level::trace)) {
6          nested = true;
7 -        exception_logger.trace("Throw exception at:\n{}", current_backtrace());
8 +        exception_logger.trace("Throw exception at:\n{}", fmt::streamed(current_backtrace()));
9          nested = false;
10      }
11  }
12 --- ceph-17.2.3/src/seastar/src/core/reactor_backend.cc.orig    2021-12-19 23:02:10.000000000 +0100
13 +++ ceph-17.2.3/src/seastar/src/core/reactor_backend.cc 2022-09-04 18:04:16.884860615 +0200
14 @@ -235,7 +235,7 @@ void aio_storage_context::schedule_retry
15              // The next call to submit_work will call schedule_retry again.
16              if (f.failed()) {
17                  auto ex = f.get_exception();
18 -                seastar_logger.warn("aio_storage_context::schedule_retry failed: {}", std::move(ex));
19 +                seastar_logger.warn("aio_storage_context::schedule_retry failed: {}", fmt::streamed(std::move(ex)));
20                  return;
21              }
22              auto result = f.get0();
23 @@ -245,7 +245,7 @@ void aio_storage_context::schedule_retry
24                  try {
25                      nr_consumed = handle_aio_error(iocbs[0], result.error);
26                  } catch (...) {
27 -                    seastar_logger.error("aio retry failed: {}. Aborting.", std::current_exception());
28 +                    seastar_logger.error("aio retry failed: {}. Aborting.", fmt::streamed(std::current_exception()));
29                      abort();
30                  }
31              } else {
32 @@ -780,7 +780,7 @@ reactor_backend_epoll::wait_and_process(
33        try {
34          maybe_switch_steady_clock_timers(timeout, _steady_clock_timer_reactor_thread, _steady_clock_timer_timer_thread);
35        } catch (...) {
36 -        seastar_logger.error("Switching steady_clock timers back failed: {}. Aborting...", std::current_exception());
37 +        seastar_logger.error("Switching steady_clock timers back failed: {}. Aborting...", fmt::streamed(std::current_exception()));
38          abort();
39        }
40      });
41 --- ceph-17.2.3/src/common/Journald.cc.orig     2022-09-04 18:08:09.890385180 +0200
42 +++ ceph-17.2.3/src/common/Journald.cc  2022-09-04 18:09:12.196980758 +0200
43 @@ -151,7 +151,7 @@ MESSAGE
44        clog_type_to_syslog_level(le.prio),
45        le.stamp.to_nsec(),
46        le.name.to_str(),
47 -      le.rank,
48 +      fmt::streamed(le.rank),
49        le.seq,
50        le.channel);
51  
52 --- ceph-17.2.3/src/seastar/src/core/future.cc.orig     2021-12-19 23:02:10.000000000 +0100
53 +++ ceph-17.2.3/src/seastar/src/core/future.cc  2022-09-04 18:12:07.369486036 +0200
54 @@ -207,7 +207,7 @@ void future_state_base::rethrow_exceptio
55  
56  void report_failed_future(const std::exception_ptr& eptr) noexcept {
57      ++engine()._abandoned_failed_futures;
58 -    seastar_logger.warn("Exceptional future ignored: {}, backtrace: {}", eptr, current_backtrace());
59 +    seastar_logger.warn("Exceptional future ignored: {}, backtrace: {}", fmt::streamed(eptr), fmt::streamed(current_backtrace()));
60  }
61  
62  void report_failed_future(const future_state_base& state) noexcept {
63 --- ceph-17.2.3/src/seastar/src/core/fstream.cc.orig    2022-08-30 09:00:26.425084492 +0200
64 +++ ceph-17.2.3/src/seastar/src/core/fstream.cc 2022-09-04 18:10:48.772037230 +0200
65 @@ -511,7 +511,7 @@ future<data_sink> make_file_data_sink(fi
66                      std::rethrow_exception(std::move(ex));
67                  } catch (...) {
68                      std::throw_with_nested(std::runtime_error(fmt::format("While handling failed construction of data_sink, caught exception: {}",
69 -                                fut.get_exception())));
70 +                                fmt::streamed(fut.get_exception()))));
71                  }
72              }
73              return make_exception_future<data_sink>(std::move(ex));
74 --- ceph-17.2.3/src/mon/LogMonitor.cc.orig      2022-07-28 23:52:12.000000000 +0200
75 +++ ceph-17.2.3/src/mon/LogMonitor.cc   2022-09-04 17:59:19.765987645 +0200
76 @@ -415,7 +415,7 @@ void LogMonitor::log_external(const LogE
77      }
78  
79      if (fd >= 0) {
80 -      fmt::format_to(file_log_buffer, "{}\n", le);
81 +      fmt::format_to(std::back_inserter(file_log_buffer), "{}\n", fmt::streamed(le));
82        int err = safe_write(fd, file_log_buffer.data(), file_log_buffer.size());
83        file_log_buffer.clear();
84        if (err < 0) {
85 --- ceph-17.2.3/src/seastar/src/core/on_internal_error.cc.orig  2021-12-19 23:02:10.000000000 +0100
86 +++ ceph-17.2.3/src/seastar/src/core/on_internal_error.cc       2022-09-04 19:01:07.218073017 +0200
87 @@ -35,7 +35,7 @@ bool seastar::set_abort_on_internal_erro
88  
89  void seastar::on_internal_error(logger& logger, std::string_view msg) {
90      if (abort_on_internal_error.load()) {
91 -        logger.error("{}, at: {}", msg, current_backtrace());
92 +        logger.error("{}, at: {}", msg, fmt::streamed(current_backtrace()));
93          abort();
94      } else {
95          throw_with_backtrace<std::runtime_error>(std::string(msg));
96 @@ -44,7 +44,7 @@ void seastar::on_internal_error(logger&
97  
98  void seastar::on_internal_error(logger& logger, std::exception_ptr ex) {
99      if (abort_on_internal_error.load()) {
100 -        logger.error("{}", ex);
101 +        logger.error("{}", fmt::streamed(ex));
102          abort();
103      } else {
104          std::rethrow_exception(std::move(ex));
105 @@ -52,7 +52,7 @@ void seastar::on_internal_error(logger&
106  }
107  
108  void seastar::on_internal_error_noexcept(logger& logger, std::string_view msg) noexcept {
109 -    logger.error("{}, at: {}", msg, current_backtrace());
110 +    logger.error("{}, at: {}", msg, fmt::streamed(current_backtrace()));
111      if (abort_on_internal_error.load()) {
112          abort();
113      }
114 --- ceph-17.2.3/src/seastar/include/seastar/util/backtrace.hh.orig      2021-12-19 23:02:10.000000000 +0100
115 +++ ceph-17.2.3/src/seastar/include/seastar/util/backtrace.hh   2022-09-04 19:27:16.336970410 +0200
116 @@ -184,7 +184,7 @@ public:
117      template<typename... Args>
118      backtraced(Args&&... args)
119              : Exc(std::forward<Args>(args)...)
120 -            , _backtrace(std::make_shared<sstring>(format("{} Backtrace: {}", Exc::what(), current_backtrace()))) {}
121 +            , _backtrace(std::make_shared<sstring>(format("{} Backtrace: {}", Exc::what(), fmt::streamed(current_backtrace())))) {}
122  
123      /**
124       * Returns the original exception message with a backtrace appended to it
125 --- ceph-17.2.3/src/seastar/src/core/prometheus.cc.orig 2021-12-19 23:02:10.000000000 +0100
126 +++ ceph-17.2.3/src/seastar/src/core/prometheus.cc      2022-09-04 19:32:16.272626166 +0200
127 @@ -532,7 +532,7 @@ future<> write_text_representation(outpu
128                      } catch (...) {
129                          auto ex = std::current_exception();
130                          // print this error as it's ignored later on by `connection::start_response`
131 -                        seastar_logger.error("prometheus: write_text_representation: {}: {}", s.str(), ex);
132 +                        seastar_logger.error("prometheus: write_text_representation: {}: {}", s.str(), fmt::streamed(ex));
133                          std::rethrow_exception(std::move(ex));
134                      }
135                      s << value_str;
136 --- ceph-17.2.3/src/seastar/src/core/memory.cc.orig     2021-12-19 23:02:10.000000000 +0100
137 +++ ceph-17.2.3/src/seastar/src/core/memory.cc  2022-09-04 19:34:50.387337178 +0200
138 @@ -754,7 +754,7 @@ cpu_pages::allocate_large_and_trim(unsig
139  void
140  cpu_pages::warn_large_allocation(size_t size) {
141      alloc_stats::increment_local(alloc_stats::types::large_allocs);
142 -    seastar_memory_logger.warn("oversized allocation: {} bytes. This is non-fatal, but could lead to latency and/or fragmentation issues. Please report: at {}", size, current_backtrace());
143 +    seastar_memory_logger.warn("oversized allocation: {} bytes. This is non-fatal, but could lead to latency and/or fragmentation issues. Please report: at {}", size, fmt::streamed(current_backtrace()));
144      large_allocation_warning_threshold *= 1.618; // prevent spam
145  }
146  
147 @@ -1616,6 +1616,15 @@ std::ostream& operator<<(std::ostream& o
148      return os;
149  }
150  
151 +}
152 +}
153 +
154 +template <>
155 +struct fmt::formatter<seastar::memory::human_readable_value> : ostream_formatter {};
156 +
157 +namespace seastar {
158 +namespace memory {
159 +
160  static human_readable_value to_human_readable_value(uint64_t value, uint64_t step, uint64_t precision, const std::array<char, 5>& suffixes) {
161      if (!value) {
162          return {0, suffixes[0]};
163 @@ -1748,7 +1757,7 @@ void maybe_dump_memory_diagnostics(size_
164      }
165  
166      disable_report_on_alloc_failure_temporarily guard;
167 -    seastar_memory_logger.debug("Failed to allocate {} bytes at {}", size, current_backtrace());
168 +    seastar_memory_logger.debug("Failed to allocate {} bytes at {}", size, fmt::streamed(current_backtrace()));
169  
170      static thread_local logger::rate_limit rate_limit(std::chrono::seconds(10));
171  
172 --- ceph-17.2.3/src/seastar/src/core/io_queue.cc.orig   2021-12-19 23:02:10.000000000 +0100
173 +++ ceph-17.2.3/src/seastar/src/core/io_queue.cc        2022-09-04 19:41:17.627629354 +0200
174 @@ -207,7 +207,7 @@ public:
175          , _fq_entry(_ioq.request_fq_ticket(dnl))
176          , _desc(std::make_unique<io_desc_read_write>(_ioq, pc, _stream, _fq_entry.ticket()))
177      {
178 -        io_log.trace("dev {} : req {} queue  len {} ticket {}", _ioq.dev_id(), fmt::ptr(&*_desc), _dnl.length(), _fq_entry.ticket());
179 +        io_log.trace("dev {} : req {} queue  len {} ticket {}", _ioq.dev_id(), fmt::ptr(&*_desc), _dnl.length(), fmt::streamed(_fq_entry.ticket()));
180      }
181  
182      queued_io_request(queued_io_request&&) = delete;
183 --- ceph-17.2.3/src/seastar/src/core/reactor.cc.orig    2021-12-19 23:02:10.000000000 +0100
184 +++ ceph-17.2.3/src/seastar/src/core/reactor.cc 2022-09-04 19:39:35.978957648 +0200
185 @@ -821,7 +821,7 @@ static decltype(auto) install_signal_han
186              throw_system_error_on(r == -1);
187          } catch (...) {
188              mem.release(); // We failed to restore previous stack, must leak it.
189 -            seastar_logger.error("Failed to restore signal stack: {}", std::current_exception());
190 +            seastar_logger.error("Failed to restore signal stack: {}", fmt::streamed(std::current_exception()));
191          }
192      });
193  }
194 @@ -1313,7 +1313,7 @@ internal::make_cpu_stall_detector(cpu_st
195      try {
196          return cpu_stall_detector_linux_perf_event::try_make(cfg);
197      } catch (...) {
198 -        seastar_logger.warn("Creation of perf_event based stall detector failed, falling back to posix timer: {}", std::current_exception());
199 +        seastar_logger.warn("Creation of perf_event based stall detector failed, falling back to posix timer: {}", fmt::streamed(std::current_exception()));
200          return std::make_unique<cpu_stall_detector_posix_timer>(cfg);
201      }
202  }
203 @@ -1389,7 +1389,7 @@ void reactor::complete_timers(T& timers,
204                  *internal::current_scheduling_group_ptr() = t->_sg;
205                  t->_callback();
206              } catch (...) {
207 -                seastar_logger.error("Timer callback failed: {}", std::current_exception());
208 +                seastar_logger.error("Timer callback failed: {}", fmt::streamed(std::current_exception()));
209              }
210          }
211      }
212 @@ -1511,7 +1511,7 @@ reactor::posix_listen(socket_address sa,
213          fd.bind(sa.u.sa, sa.length());
214          fd.listen(opts.listen_backlog);
215      } catch (const std::system_error& s) {
216 -        throw std::system_error(s.code(), fmt::format("posix_listen failed for address {}", sa));
217 +        throw std::system_error(s.code(), fmt::format("posix_listen failed for address {}", fmt::streamed(sa)));
218      }
219  
220      return pollable_fd(std::move(fd));
221 @@ -3487,7 +3487,7 @@ reactor_options::reactor_options(program
222                   " The diagnostics will be written to the seastar_memory logger, with error level."
223                   " Note that if the seastar_memory logger is set to debug or trace level, the diagnostics will be logged irrespective of this setting.")
224      , reactor_backend(*this, "reactor-backend", backend_selector_candidates(), reactor_backend_selector::default_backend().name(),
225 -                format("Internal reactor implementation ({})", reactor_backend_selector::available()))
226 +                format("Internal reactor implementation ({})", fmt::streamed(reactor_backend_selector::available())))
227      , aio_fsync(*this, "aio-fsync", kernel_supports_aio_fsync(),
228                  "Use Linux aio for fsync() calls. This reduces latency; requires Linux 4.18 or later.")
229      , max_networking_io_control_blocks(*this, "max-networking-io-control-blocks", 10000,
230 @@ -4207,7 +4207,7 @@ bool smp::pure_poll_queues() {
231  __thread reactor* local_engine;
232  
233  void report_exception(std::string_view message, std::exception_ptr eptr) noexcept {
234 -    seastar_logger.error("{}: {}", message, eptr);
235 +    seastar_logger.error("{}: {}", message, fmt::streamed(eptr));
236  }
237  
238  future<> check_direct_io_support(std::string_view path) noexcept {
239 --- ceph-17.2.3/src/seastar/src/http/httpd.cc.orig      2021-12-19 23:02:10.000000000 +0100
240 +++ ceph-17.2.3/src/seastar/src/http/httpd.cc   2022-09-04 20:20:30.365222925 +0200
241 @@ -310,12 +310,12 @@ future<> connection::process() {
242          try {
243              std::get<0>(joined).get();
244          } catch (...) {
245 -            hlogger.debug("Read exception encountered: {}", std::current_exception());
246 +            hlogger.debug("Read exception encountered: {}", fmt::streamed(std::current_exception()));
247          }
248          try {
249              std::get<1>(joined).get();
250          } catch (...) {
251 -            hlogger.debug("Response exception encountered: {}", std::current_exception());
252 +            hlogger.debug("Response exception encountered: {}", fmt::streamed(std::current_exception()));
253          }
254          return make_ready_future<>();
255      });
256 @@ -519,17 +519,17 @@ future<> http_server::do_accept_one(int
257          auto conn = std::make_unique<connection>(*this, std::move(ar.connection), std::move(ar.remote_address));
258          (void)try_with_gate(_task_gate, [conn = std::move(conn)]() mutable {
259              return conn->process().handle_exception([conn = std::move(conn)] (std::exception_ptr ex) {
260 -                hlogger.error("request error: {}", ex);
261 +                hlogger.error("request error: {}", fmt::streamed(ex));
262              });
263          }).handle_exception_type([] (const gate_closed_exception& e) {});
264      }).handle_exception_type([] (const std::system_error &e) {
265          // We expect a ECONNABORTED when http_server::stop is called,
266          // no point in warning about that.
267          if (e.code().value() != ECONNABORTED) {
268 -            hlogger.error("accept failed: {}", e);
269 +            hlogger.error("accept failed: {}", fmt::streamed(e));
270          }
271      }).handle_exception([] (std::exception_ptr ex) {
272 -        hlogger.error("accept failed: {}", ex);
273 +        hlogger.error("accept failed: {}", fmt::streamed(ex));
274      });
275  }
276  
277 --- ceph-17.2.3/src/tools/neorados.cc.orig      2022-08-30 09:00:26.418417475 +0200
278 +++ ceph-17.2.3/src/tools/neorados.cc   2022-09-04 20:23:19.850824080 +0200
279 @@ -55,7 +55,7 @@ void printseq(const V& v, std::ostream&
280  {
281    std::for_each(v.cbegin(), v.cend(),
282                 [&m](const auto& e) {
283 -                 fmt::print(m, "{}\n", e);
284 +                 fmt::print(m, "{}\n", fmt::streamed(e));
285                 });
286  }
287  
288 @@ -321,7 +321,7 @@ int main(int argc, char* argv[])
289      po::notify(vm);
290  
291      if (vm.count("help")) {
292 -      fmt::print("{}", desc);
293 +      fmt::print("{}", fmt::streamed(desc));
294        fmt::print("Commands:\n");
295        for (const auto& cmd : commands) {
296         fmt::print("    {} {}{}{}\n",
297 --- ceph-17.2.3/src/seastar/src/net/dns.cc.orig 2021-12-19 23:02:10.000000000 +0100
298 +++ ceph-17.2.3/src/seastar/src/net/dns.cc      2022-09-04 20:36:25.288504129 +0200
299 @@ -238,7 +238,7 @@ public:
300              sstring name;
301          };
302  
303 -        dns_log.debug("Query name {} ({})", name, family);
304 +        dns_log.debug("Query name {} ({})", name, fmt::streamed(family));
305  
306          if (!family) {
307              auto res = inet_address::parse_numerical(name);
308 @@ -291,7 +291,7 @@ public:
309              inet_address addr;
310          };
311  
312 -        dns_log.debug("Query addr {}", addr);
313 +        dns_log.debug("Query addr {}", fmt::streamed(addr));
314  
315          auto p = new promise_wrap(std::move(addr));
316          auto f = p->get_future();
317 @@ -501,7 +501,7 @@ private:
318              ++p;
319          }
320  
321 -        dns_log.debug("Query success: {}/{}", e.names.front(), e.addr_list.front());
322 +        dns_log.debug("Query success: {}/{}", e.names.front(), fmt::streamed(e.addr_list.front()));
323  
324          return e;
325      }
326 @@ -599,7 +599,7 @@ private:
327              auto& e = get_socket_entry(fd);
328              auto sa = sock_addr(addr, len);
329  
330 -            dns_log.trace("Connect {}({})->{}", fd, int(e.typ), sa);
331 +            dns_log.trace("Connect {}({})->{}", fd, int(e.typ), fmt::streamed(sa));
332  
333              assert(e.avail == 0);
334  
335 @@ -618,7 +618,7 @@ private:
336                              e.tcp.socket = f.get0();
337                              dns_log.trace("Connection complete: {}", fd);
338                          } catch (...) {
339 -                            dns_log.debug("Connect {} failed: {}", fd, std::current_exception());
340 +                            dns_log.debug("Connect {} failed: {}", fd, fmt::streamed(std::current_exception()));
341                          }
342                          e.avail = POLLOUT|POLLIN;
343                          me->poll_sockets();
344 @@ -682,7 +682,7 @@ private:
345                                  dns_log.trace("Read {} -> {} bytes", fd, buf.size());
346                                  e.tcp.indata = std::move(buf);
347                              } catch (...) {
348 -                                dns_log.debug("Read {} failed: {}", fd, std::current_exception());
349 +                                dns_log.debug("Read {} failed: {}", fd, fmt::streamed(std::current_exception()));
350                              }
351                              e.avail |= POLLIN; // always reset state
352                              me->poll_sockets();
353 @@ -708,7 +708,7 @@ private:
354                      if (udp.in) {
355                          auto & p = udp.in->get_data();
356  
357 -                        dns_log.trace("Read {}. {} bytes available from {}", fd, p.len(), udp.in->get_src());
358 +                        dns_log.trace("Read {}. {} bytes available from {}", fd, p.len(), fmt::streamed(udp.in->get_src()));
359  
360                          if (from != nullptr) {
361                              *from = socket_address(udp.in->get_src()).as_posix_sockaddr();
362 @@ -746,7 +746,7 @@ private:
363                                  e.udp.in = std::move(d);
364                                  e.avail |= POLLIN;
365                              } catch (...) {
366 -                                dns_log.debug("Read {} failed: {}", fd, std::current_exception());
367 +                                dns_log.debug("Read {} failed: {}", fd, fmt::streamed(std::current_exception()));
368                              }
369                              me->poll_sockets();
370                              me->release(fd);
371 @@ -840,7 +840,7 @@ private:
372                              f.get();
373                              dns_log.trace("Send {}. {} bytes sent.", fd, bytes);
374                          } catch (...) {
375 -                            dns_log.debug("Send {} failed: {}", fd, std::current_exception());
376 +                            dns_log.debug("Send {} failed: {}", fd, fmt::streamed(std::current_exception()));
377                          }
378                          e.avail |= POLLOUT;
379                          me->poll_sockets();
380 --- ceph-17.2.3/src/seastar/src/util/alloc_failure_injector.cc.orig     2021-12-19 23:02:10.000000000 +0100
381 +++ ceph-17.2.3/src/seastar/src/util/alloc_failure_injector.cc  2022-09-04 20:37:46.729440078 +0200
382 @@ -35,7 +35,7 @@ void alloc_failure_injector::fail() {
383      _failed = true;
384      cancel();
385      if (log.is_enabled(log_level::trace)) {
386 -        log.trace("Failing at {}", current_backtrace());
387 +        log.trace("Failing at {}", fmt::streamed(current_backtrace()));
388      }
389      _on_alloc_failure();
390  }
391 --- ceph-17.2.3/src/seastar/src/rpc/rpc.cc.orig 2021-12-19 23:02:10.000000000 +0100
392 +++ ceph-17.2.3/src/seastar/src/rpc/rpc.cc      2022-09-04 20:49:25.379426601 +0200
393 @@ -10,11 +10,11 @@ namespace seastar {
394  namespace rpc {
395  
396      void logger::operator()(const client_info& info, id_type msg_id, const sstring& str) const {
397 -        log(format("client {} msg_id {}:  {}", info.addr, msg_id, str));
398 +        log(format("client {} msg_id {}:  {}", fmt::streamed(info.addr), msg_id, str));
399      }
400  
401      void logger::operator()(const client_info& info, id_type msg_id, log_level level, std::string_view str) const {
402 -        log(level, "client {} msg_id {}:  {}", info.addr, msg_id, str);
403 +        log(level, "client {} msg_id {}:  {}", fmt::streamed(info.addr), msg_id, str);
404      }
405  
406      void logger::operator()(const client_info& info, const sstring& str) const {
407 @@ -26,11 +26,11 @@ namespace rpc {
408      }
409  
410      void logger::operator()(const socket_address& addr, const sstring& str) const {
411 -        log(format("client {}: {}", addr, str));
412 +        log(format("client {}: {}", fmt::streamed(addr), str));
413      }
414  
415      void logger::operator()(const socket_address& addr, log_level level, std::string_view str) const {
416 -        log(level, "client {}: {}", addr, str);
417 +        log(level, "client {}: {}", fmt::streamed(addr), str);
418      }
419  
420    no_wait_type no_wait;
421 @@ -790,7 +790,7 @@ namespace rpc {
422                    f = smp::submit_to(_parent_id.shard(), [this, c = make_foreign(static_pointer_cast<rpc::connection>(shared_from_this()))] () mutable {
423                        auto sit = _servers.find(*_server._options.streaming_domain);
424                        if (sit == _servers.end()) {
425 -                          throw std::logic_error(format("Shard {:d} does not have server with streaming domain {:x}", this_shard_id(), *_server._options.streaming_domain).c_str());
426 +                          throw std::logic_error(format("Shard {:d} does not have server with streaming domain {}", this_shard_id(), fmt::streamed(*_server._options.streaming_domain)).c_str());
427                        }
428                        auto s = sit->second;
429                        auto it = s->_conns.find(_parent_id);
430 @@ -1010,7 +1010,7 @@ future<> server::connection::send_unknow
431    {
432        if (_options.streaming_domain) {
433            if (_servers.find(*_options.streaming_domain) != _servers.end()) {
434 -              throw std::runtime_error(format("An RPC server with the streaming domain {} is already exist", *_options.streaming_domain));
435 +              throw std::runtime_error(format("An RPC server with the streaming domain {} is already exist", fmt::streamed(*_options.streaming_domain)));
436            }
437            _servers[*_options.streaming_domain] = this;
438        }
439 --- ceph-17.2.3/src/seastar/src/util/log.cc.orig        2021-12-19 23:02:10.000000000 +0100
440 +++ ceph-17.2.3/src/seastar/src/util/log.cc     2022-09-04 20:50:15.945414934 +0200
441 @@ -312,7 +312,7 @@ void logger::failed_to_log(std::exceptio
442              if (!fmt.format.empty()) {
443                  it = fmt::format_to(it, ": fmt='{}'", fmt.format);
444              }
445 -            return fmt::format_to(it, ": {}", ex);
446 +            return fmt::format_to(it, ": {}", fmt::streamed(ex));
447          });
448          do_log(log_level::error, writer);
449      } catch (...) {
450 @@ -577,7 +577,7 @@ std::ostream& operator<<(std::ostream& o
451          try {
452              throw;
453          } catch (const seastar::nested_exception& ne) {
454 -            out << fmt::format(": {} (while cleaning up after {})", ne.inner, ne.outer);
455 +            out << fmt::format(": {} (while cleaning up after {})", fmt::streamed(ne.inner), fmt::streamed(ne.outer));
456          } catch (const std::system_error& e) {
457              out << " (error " << e.code() << ", " << e.what() << ")";
458          } catch (const std::exception& e) {
459 --- ceph-17.2.3/src/seastar/src/websocket/server.cc.orig        2021-12-19 23:02:10.000000000 +0100
460 +++ ceph-17.2.3/src/seastar/src/websocket/server.cc     2022-09-04 20:50:55.620831451 +0200
461 @@ -69,17 +69,17 @@ future<> server::do_accept_one(int which
462          auto conn = std::make_unique<connection>(*this, std::move(ar.connection));
463          (void)try_with_gate(_task_gate, [conn = std::move(conn)]() mutable {
464              return conn->process().handle_exception([conn = std::move(conn)] (std::exception_ptr ex) {
465 -                wlogger.error("request error: {}", ex);
466 +                wlogger.error("request error: {}", fmt::streamed(ex));
467              });
468          }).handle_exception_type([] (const gate_closed_exception& e) {});
469      }).handle_exception_type([] (const std::system_error &e) {
470          // We expect a ECONNABORTED when server::stop is called,
471          // no point in warning about that.
472          if (e.code().value() != ECONNABORTED) {
473 -            wlogger.error("accept failed: {}", e);
474 +            wlogger.error("accept failed: {}", fmt::streamed(e));
475          }
476      }).handle_exception([] (std::exception_ptr ex) {
477 -        wlogger.error("accept failed: {}", ex);
478 +        wlogger.error("accept failed: {}", fmt::streamed(ex));
479      });
480  }
481  
482 @@ -108,12 +108,12 @@ future<> connection::process() {
483          try {
484              std::get<0>(joined).get();
485          } catch (...) {
486 -            wlogger.debug("Read exception encountered: {}", std::current_exception());
487 +            wlogger.debug("Read exception encountered: {}", fmt::streamed(std::current_exception()));
488          }
489          try {
490              std::get<1>(joined).get();
491          } catch (...) {
492 -            wlogger.debug("Response exception encountered: {}", std::current_exception());
493 +            wlogger.debug("Response exception encountered: {}", fmt::streamed(std::current_exception()));
494          }
495          return make_ready_future<>();
496      });
497 @@ -183,7 +183,7 @@ future<> connection::read_loop() {
498          });
499      }).then_wrapped([this] (future<> f) {
500          if (f.failed()) {
501 -            wlogger.error("Read failed: {}", f.get_exception());
502 +            wlogger.error("Read failed: {}", fmt::streamed(f.get_exception()));
503          }
504          return _replies.push_eventually({});
505      }).finally([this] {
506 --- ceph-17.2.3/src/mon/MonMap.cc.orig  2022-07-28 23:52:12.000000000 +0200
507 +++ ceph-17.2.3/src/mon/MonMap.cc       2022-09-04 21:16:11.447309592 +0200
508 @@ -796,12 +796,12 @@ seastar::future<> MonMap::init_with_dns_
509                              false);
510        }).handle_exception_type([t=record.target](const std::system_error& e) {
511          logger().debug("{}: unable to resolve name for {}: {}",
512 -                       "init_with_dns_srv", t, e);
513 +                       "init_with_dns_srv", t, fmt::streamed(e));
514        });
515      });
516    }).handle_exception_type([name](const std::system_error& e) {
517      logger().debug("{}: unable to get monitor info from DNS SRV with {}: {}",
518 -                 "init_with_dns_srv", name, e);
519 +                 "init_with_dns_srv", name, fmt::streamed(e));
520      // ignore DNS failures
521      return seastar::make_ready_future<>();
522    });
523 --- ceph-17.2.3/src/crimson/common/assert.cc.orig       2022-07-28 23:52:12.000000000 +0200
524 +++ ceph-17.2.3/src/crimson/common/assert.cc    2022-09-04 21:27:06.935556194 +0200
525 @@ -22,7 +22,7 @@ namespace ceph {
526      logger.error("{}:{} : In function '{}', ceph_assert(%s)\n"
527                   "{}",
528                   file, line, func, assertion,
529 -                 seastar::current_backtrace());
530 +                 fmt::streamed(seastar::current_backtrace()));
531      std::cout << std::flush;
532      abort();
533    }
534 @@ -42,7 +42,7 @@ namespace ceph {
535                   "{}\n{}\n",
536                   file, line, func, assertion,
537                   buf,
538 -                 seastar::current_backtrace());
539 +                 fmt::streamed(seastar::current_backtrace()));
540      std::cout << std::flush;
541      abort();
542    }
543 @@ -54,7 +54,7 @@ namespace ceph {
544      logger.error("{}:{} : In function '{}', abort(%s)\n"
545                   "{}",
546                   file, line, func, msg,
547 -                 seastar::current_backtrace());
548 +                 fmt::streamed(seastar::current_backtrace()));
549      std::cout << std::flush;
550      abort();
551    }
552 @@ -74,7 +74,7 @@ namespace ceph {
553                   "{}\n{}\n",
554                   file, line, func,
555                   buf,
556 -                 seastar::current_backtrace());
557 +                 fmt::streamed(seastar::current_backtrace()));
558      std::cout << std::flush;
559      abort();
560    }
561 --- ceph-17.2.3/src/crimson/admin/admin_socket.cc.orig  2022-07-28 23:52:12.000000000 +0200
562 +++ ceph-17.2.3/src/crimson/admin/admin_socket.cc       2022-09-04 21:25:31.307155684 +0200
563 @@ -77,7 +77,7 @@ auto AdminSocket::parse_cmd(const std::v
564        return tell_result_t{-EINVAL, "invalid json", std::move(out)};
565      }
566    } catch (const std::runtime_error& e) {
567 -    logger().error("{}: incoming command syntax: {}", __func__, cmd);
568 +    logger().error("{}: incoming command syntax: {}", __func__, fmt::streamed(cmd));
569      out.append(string{e.what()});
570      return tell_result_t{-EINVAL, "invalid json", std::move(out)};
571    }
572 @@ -88,7 +88,7 @@ auto AdminSocket::parse_cmd(const std::v
573      cmd_getval(cmdmap, "format", format);
574      cmd_getval(cmdmap, "prefix", prefix);
575    } catch (const bad_cmd_get& e) {
576 -    logger().error("{}: invalid syntax: {}", __func__, cmd);
577 +    logger().error("{}: invalid syntax: {}", __func__, fmt::streamed(cmd));
578      out.append(string{e.what()});
579      return tell_result_t{-EINVAL, "invalid json", std::move(out)};
580    }
581 @@ -155,7 +155,7 @@ auto AdminSocket::execute_command(const
582      string desc{parsed->hook.desc};
583      if (!validate_cmd(nullptr, desc, parsed->params, os)) {
584        logger().error("AdminSocket::execute_command: "
585 -                     "failed to validate '{}': {}", cmd, os.str());
586 +                     "failed to validate '{}': {}", fmt::streamed(cmd), os.str());
587        ceph::bufferlist out;
588        out.append(os);
589        return seastar::make_ready_future<tell_result_t>(
590 @@ -208,7 +208,7 @@ seastar::future<> AdminSocket::handle_cl
591    }).then([&in] {
592      return in.close();
593    }).handle_exception([](auto ep) {
594 -    logger().debug("exception on {}: {}", __func__, ep);
595 +    logger().debug("exception on {}: {}", __func__, fmt::streamed(ep));
596    });
597  }
598  
599 @@ -245,7 +245,7 @@ seastar::future<> AdminSocket::start(con
600          });
601        }).handle_exception([this](auto ep) {
602          if (!stop_gate.is_closed()) {
603 -          logger().error("AdminSocket: terminated: {}", ep);
604 +          logger().error("AdminSocket: terminated: {}", fmt::streamed(ep));
605          }
606        });
607      });
608 --- ceph-17.2.3/src/crimson/admin/osd_admin.cc.orig     2022-09-04 21:48:44.290691903 +0200
609 +++ ceph-17.2.3/src/crimson/admin/osd_admin.cc  2022-09-04 21:48:48.797593322 +0200
610 @@ -299,7 +299,7 @@ static ghobject_t test_ops_get_object_na
611        // the return type of `fmt::format` is `std::string`
612        using namespace fmt::literals;
613        throw std::invalid_argument{
614 -        "Invalid pool '{}'"_format(*pool_arg)
615 +       fmt::format("Invalid pool '{}'", *pool_arg)
616        };
617      }
618      return pool;
619 @@ -367,7 +367,7 @@ public:
620                                                        e.what());
621      }
622      return shard_services.get_store().inject_data_error(obj).then([=] {
623 -      logger().info("successfully injected data error for obj={}", obj);
624 +      logger().info("successfully injected data error for obj={}", fmt::streamed(obj));
625        ceph::bufferlist bl;
626        bl.append("ok"sv);
627        return seastar::make_ready_future<tell_result_t>(0,
628 @@ -409,7 +409,7 @@ public:
629                                                        e.what());
630      }
631      return shard_services.get_store().inject_mdata_error(obj).then([=] {
632 -      logger().info("successfully injected metadata error for obj={}", obj);
633 +      logger().info("successfully injected metadata error for obj={}", fmt::streamed(obj));
634        ceph::bufferlist bl;
635        bl.append("ok"sv);
636        return seastar::make_ready_future<tell_result_t>(0,
637 --- ceph-17.2.3/src/crimson/admin/pg_commands.cc.orig   2022-07-28 23:52:12.000000000 +0200
638 +++ ceph-17.2.3/src/crimson/admin/pg_commands.cc        2022-09-04 21:34:44.833110723 +0200
639 @@ -59,11 +59,11 @@ public:
640      Ref<PG> pg = osd.get_pg(spg_id);
641      if (!pg) {
642        return seastar::make_ready_future<tell_result_t>(tell_result_t{
643 -        -ENOENT, fmt::format("i don't have pgid '{}'", spg_id)});
644 +        -ENOENT, fmt::format("i don't have pgid '{}'", fmt::streamed(spg_id))});
645      }
646      if (!pg->is_primary()) {
647        return seastar::make_ready_future<tell_result_t>(tell_result_t{
648 -        -EAGAIN, fmt::format("not primary for pgid '{}'", spg_id)});
649 +        -EAGAIN, fmt::format("not primary for pgid '{}'", fmt::streamed(spg_id))});
650      }
651      return this->do_command(pg, cmdmap, format, std::move(input));
652    }
653 --- ceph-17.2.3/src/crimson/common/logclient.cc.orig    2022-07-28 23:52:12.000000000 +0200
654 +++ ceph-17.2.3/src/crimson/common/logclient.cc 2022-09-04 22:22:38.523982693 +0200
655 @@ -139,7 +139,7 @@ void LogChannel::update_config(map<strin
656  {
657    logger().debug(
658      "{} log_to_monitors {} log_to_syslog {} log_channels {} log_prios {}",
659 -    __func__, log_to_monitors, log_to_syslog, log_channels, log_prios);
660 +    __func__, fmt::streamed(log_to_monitors), fmt::streamed(log_to_syslog), fmt::streamed(log_channels), fmt::streamed(log_prios));
661    bool to_monitors = (get_str_map_key(log_to_monitors, log_channel,
662                                        &CLOG_CONFIG_DEFAULT_KEY) == "true");
663    bool to_syslog = (get_str_map_key(log_to_syslog, log_channel,
664 @@ -286,7 +286,7 @@ MessageURef LogClient::_get_mon_log_mess
665      ceph_assert(log_iter != log_queue.end());
666      out_log_queue.push_back(*log_iter);
667      last_log_sent = log_iter->seq;
668 -    logger().debug(" will send {}", *log_iter);
669 +    logger().debug(" will send {}", fmt::streamed(*log_iter));
670      ++log_iter;
671    }
672    
673 @@ -332,7 +332,7 @@ const EntityName& LogClient::get_myname(
674  
675  seastar::future<> LogClient::handle_log_ack(Ref<MLogAck> m)
676  {
677 -  logger().debug("handle_log_ack {}", *m);
678 +  logger().debug("handle_log_ack {}", fmt::streamed(*m));
679  
680    version_t last = m->last;
681  
682 @@ -341,7 +341,7 @@ seastar::future<> LogClient::handle_log_
683      const LogEntry &entry(*q);
684      if (entry.seq > last)
685        break;
686 -    logger().debug(" logged {}", entry);
687 +    logger().debug(" logged {}", fmt::streamed(entry));
688      q = log_queue.erase(q);
689    }
690    return seastar::now();
This page took 0.125455 seconds and 4 git commands to generate.