Skip to content

Commit

Permalink
rpc: pass start time to wait_for_reply() which accepts no_wait_type
Browse files Browse the repository at this point in the history
in 41ee6ee, we enable the client to calculate the delay by passing the
start time point to `wait_for_reply()`, but there are three overloads
of `wait_for_reply()`

- for wait_type
- for no_wait
- for future<no_wait>

in 41ee6ee, we updated the first two of them. but missed the last one.

and this breaks the build of scylladb, if it is built with the seastar
including the said commit. as scylladb actually uses the 3rd overload.
the compiler errors out, like

```
/usr/bin/clang++ -DDEVEL -DFMT_SHARED -DSCYLLA_BUILD_MODE=dev -DSCYLLA_ENABLE_ERROR_INJECTION -DSEASTAR_API_LEVEL=7 -DSEASTAR_ENABLE_ALLOC_FAILURE_INJECTION -DSEASTAR_LOGGER_COMPILE_TIME_FMT -DSEASTAR_LOGGER_TYPE_STDOUT -DSEASTAR_SCHEDULING_GROUPS_COUNT=16 -DSEASTAR_SSTRING -DSEASTAR_TYPE_ERASE_MORE -DXXH_PRIVATE_API -I/__w/scylladb/scylladb -I/__w/scylladb/scylladb/seastar/include -I/__w/scylladb/scylladb/build/seastar/gen/include -I/__w/scylladb/scylladb/build/seastar/gen/src -I/__w/scylladb/scylladb/build/gen -isystem /__w/scylladb/scylladb/abseil -O2 -std=gnu++23 -fvisibility=hidden -Wall -Werror -Wextra -Wno-error=deprecated-declarations -Wimplicit-fallthrough -Wno-c++11-narrowing -Wno-deprecated-copy -Wno-mismatched-tags -Wno-missing-field-initializers -Wno-overloaded-virtual -Wno-unsupported-friend -Wno-enum-constexpr-conversion -Wno-unused-parameter -ffile-prefix-map=/__w/scylladb/scylladb=. -march=westmere -U_FORTIFY_SOURCE -Werror=unused-result -fstack-clash-protection -MD -MT message/CMakeFiles/message.dir/messaging_service.cc.o -MF message/CMakeFiles/message.dir/messaging_service.cc.o.d -o message/CMakeFiles/message.dir/messaging_service.cc.o -c /__w/scylladb/scylladb/message/messaging_service.cc
In file included from /__w/scylladb/scylladb/message/messaging_service.cc:23:
In file included from /__w/scylladb/scylladb/seastar/include/seastar/rpc/rpc.hh:973:
/__w/scylladb/scylladb/seastar/include/seastar/rpc/rpc_impl.hh:484:97: error: no matching function for call to 'wait_for_reply'
  484 |             return when_all(dst.request(uint64_t(t), msg_id, std::move(data), timeout, cancel), wait_for_reply<Serializer>(wait(), timeout, start, cancel, dst, msg_id, sig)).then([] (auto r) {
      |                                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
/__w/scylladb/scylladb/seastar/include/seastar/rpc/rpc_impl.hh:468:12: note: in instantiation of member function 'seastar::rpc::send_helper(netw::messaging_verb, signature<future<no_wait_type> (tagged_uuid<group_id_tag>, tagged_uuid<server_id_tag>, tagged_uuid<server_id_tag>, append_request)>)::shelper::send' requested here
  468 |     struct shelper {
      |            ^
/__w/scylladb/scylladb/seastar/include/seastar/rpc/rpc_impl.hh:664:12: note: in instantiation of function template specialization 'seastar::rpc::send_helper<netw::serializer, netw::messaging_verb, seastar::future<seastar::rpc::no_wait_type>, utils::tagged_uuid<raft::group_id_tag>, utils::tagged_uuid<raft::server_id_tag>, utils::tagged_uuid<raft::server_id_tag>, raft::append_request>' requested here
  664 |     return send_helper<Serializer>(t, sig_type());
      |            ^
```

so, in this change, we pass a unused start timepoint to the 3rd
overload.

after this change, scylla builds with seastar just fine.

Refs 41ee6ee
Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed Jul 6, 2024
1 parent 76d696c commit 3deac5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/seastar/rpc/rpc_impl.hh
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ inline auto wait_for_reply(no_wait_type, std::optional<rpc_clock_type::time_poin
}

template<typename Serializer, typename... InArgs>
inline auto wait_for_reply(no_wait_type, std::optional<rpc_clock_type::time_point>, cancellable*, rpc::client&, id_type,
inline auto wait_for_reply(no_wait_type, std::optional<rpc_clock_type::time_point>, rpc_clock_type::time_point, cancellable*, rpc::client&, id_type,
signature<future<no_wait_type> (InArgs...)>) { // future<no_wait> overload
return make_ready_future<>();
}
Expand Down

0 comments on commit 3deac5e

Please sign in to comment.