Skip to content

http/client: make abort_source passed to connection_factory::make() optional#2428

Closed
tchaikov wants to merge 1 commit intoscylladb:masterfrom
tchaikov:http-client-make
Closed

http/client: make abort_source passed to connection_factory::make() optional#2428
tchaikov wants to merge 1 commit intoscylladb:masterfrom
tchaikov:http-client-make

Conversation

@tchaikov
Copy link
Copy Markdown
Contributor

in 35badf5, we added abortable make_request() API. and added an abort_source pointer to connection_factory::make(), but this broke the build of existing classes which inherit from connection_factory. as they don't implement a make() with this parameter:

In file included from /home/kefu/dev/scylladb/tools/scylla-nodetool.cc:52:
/home/kefu/dev/scylladb/utils/http.hh:67:38: error: 'make' marked 'override' but does not override any member functions
   67 |     virtual future<connected_socket> make() override {
      |                                      ^
In file included from /home/kefu/dev/scylladb/tools/scylla-nodetool.cc:11:
In file included from /usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/chrono:49:
In file included from /usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/shared_ptr.h:53:
In file included from /usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/shared_ptr_base.h:59:
/usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/unique_ptr.h:1076:34: error: allocating an object of abstract class type 'utils::http::dns_connection_factory'
 1076 |     { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
      |                                  ^
/home/kefu/dev/scylladb/tools/scylla-nodetool.cc:185:28: note: in instantiation of function template specialization 'std::make_unique<utils::http::dns_connection_factory, seastar::basic_sstring<char, unsigned int, 15> &, unsigned short &, bool, seastar::logger &>' requested here
  185 |         , _api_client(std::make_unique<utils::http::dns_connection_factory>(_host, _port, false, nlog), 1)
      |                            ^
/home/kefu/dev/scylladb/seastar/include/seastar/http/client.hh:155:38: note: unimplemented pure virtual method 'make' in 'dns_connection_factory'
  155 |     virtual future<connected_socket> make(abort_source*) = 0;
      |                                      ^

in this change, in order to fix the build, let's make this parameter optional.

Refs 35badf5
Signed-off-by: Kefu Chai kefu.chai@scylladb.com

… optional

in 35badf5, we added abortable `make_request()` API. and added an
`abort_source` pointer to `connection_factory::make()`, but this broke
the build of existing classes which inherit from `connection_factory`.
as they don't implement a `make()` with this parameter:
```
In file included from /home/kefu/dev/scylladb/tools/scylla-nodetool.cc:52:
/home/kefu/dev/scylladb/utils/http.hh:67:38: error: 'make' marked 'override' but does not override any member functions
   67 |     virtual future<connected_socket> make() override {
      |                                      ^
In file included from /home/kefu/dev/scylladb/tools/scylla-nodetool.cc:11:
In file included from /usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/chrono:49:
In file included from /usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/shared_ptr.h:53:
In file included from /usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/shared_ptr_base.h:59:
/usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/unique_ptr.h:1076:34: error: allocating an object of abstract class type 'utils::http::dns_connection_factory'
 1076 |     { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
      |                                  ^
/home/kefu/dev/scylladb/tools/scylla-nodetool.cc:185:28: note: in instantiation of function template specialization 'std::make_unique<utils::http::dns_connection_factory, seastar::basic_sstring<char, unsigned int, 15> &, unsigned short &, bool, seastar::logger &>' requested here
  185 |         , _api_client(std::make_unique<utils::http::dns_connection_factory>(_host, _port, false, nlog), 1)
      |                            ^
/home/kefu/dev/scylladb/seastar/include/seastar/http/client.hh:155:38: note: unimplemented pure virtual method 'make' in 'dns_connection_factory'
  155 |     virtual future<connected_socket> make(abort_source*) = 0;
      |                                      ^
```

in this change, in order to fix the build, let's make this parameter
optional.

Refs 35badf5
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
@tchaikov
Copy link
Copy Markdown
Contributor Author

nah, this does address the problem.

@tchaikov tchaikov deleted the http-client-make branch September 12, 2024 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant