Seastar - assertion `thread' failed

Hello everyone,

The question is more about seastar programming but since it connected to ScyllaDB development would ask here. Could please somebody explain me the situation:
when I use construction similar to this
seastar::future<> foo3() {
return seastar::make_ready_future<>();
}

seastar::future<> foo1() {
return seastar::make_ready_future<>();
}

seastar::future<> foo2() {
return foo3().then( {
});
}

seastar::future<> work() {
return foo1().then( {
foo2().get();
//…

at runtime I get an assertion and the process ends
“future.cc:248: void seastar::internal::future_base::do_wait(): Assertion `thread’ failed”

I suspect the source of problem but can’t guess how to resolve it. Tried to wrap functions to seastar::async but it doesn’t work.
Would appreciate any help.
Thank you.

You can also try on the seastar group
https://groups.google.com/g/seastar-dev

You cannot use get() outside of a seastar thread context. A seastar thread can be created by:

return async([] {
   f.get(); // here, it is legal to call future<>::get()
});
1 Like