]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
crimson/os: fix FTBFS on recent versions of Seastar.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 30 Nov 2021 13:49:04 +0000 (13:49 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 30 Nov 2021 14:27:30 +0000 (14:27 +0000)
commit2bebee6b37f9d6f3361999b6164bf15492bc675b
treed4563bec9857e7714dd2fba059bfc5d7600ccd26
parent8ca0012e47ee3a2092320b30b8ea10a896bb6561
crimson/os: fix FTBFS on recent versions of Seastar.

Seastar since c4516f564197da409c1e5a012bd24c35457a9a40 provides
two variants of `seastar::with_lock`:
  - generic, friendly towards throwing move constructors of
    the passed callable,
  - specialized for `noexcept`.

Unfortunately, the former has a limitation: the return value of
callable must be compatible with `current_exception_as_future()`
which boils down to returning `seastar::future<void>`. Therefore
we need to use the latter. The obstacle is `boost::intrusive_ptr`
we use for `CollectionRef` as it has the move constructor defined
without `noexcept`:

```cpp
emplate<class T> class intrusive_ptr
{
    //
    BOOST_CONSTEXPR intrusive_ptr() BOOST_SP_NOEXCEPT : px( 0 )
    {
    }

    // ...

    template<class U>

    intrusive_ptr( intrusive_ptr<U> const & rhs, typename boost::detail::sp_enable_if_convertible<U,T>::type = boost::detail::sp_empty() )

    intrusive_ptr( intrusive_ptr<U> const & rhs )

    : px( rhs.get() )
    {
        if( px != 0 ) intrusive_ptr_add_ref( px );
    }

    // ...

    intrusive_ptr(intrusive_ptr && rhs) BOOST_SP_NOEXCEPT : px( rhs.px )
    {
        rhs.px = 0;
    }

    intrusive_ptr & operator=(intrusive_ptr && rhs) BOOST_SP_NOEXCEPT
    {
        this_type( static_cast< intrusive_ptr && >( rhs ) ).swap(*this);
        return *this;
    }

```

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/os/alienstore/alien_collection.h
src/crimson/os/alienstore/alien_store.cc