Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch coroutine wait to CondVar #2032

Merged
merged 1 commit into from
Sep 14, 2024

Conversation

komarevtsev-d
Copy link
Collaborator

@komarevtsev-d komarevtsev-d commented Sep 14, 2024

Откатываю обратно на TCondVar, т.к. здесь https://github.com/ydb-platform/nbs/blob/6edba2c/cloud/blockstore/libs/endpoints_vhost/external_vhost_server.cpp#L620 стреляет verify
https://github.com/ydb-platform/nbs/blob/6edba2c/library/cpp/coroutine/engine/impl.cpp#L375

Thread 13241 (LWP 2698928):
#0 __lll_lock_wait () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 pthread_mutex_lock () from /lib/x86_64-linux-gnu/libpthread.so.0
#2 google_breakpad::ExceptionHandler::SignalHandler (sig=11, info=0x7f0e5f5f8b30, uc=0x7f0e5f5f8a00) at src/client/linux/handler/exception_handler.cc +342
#3 <signal handler called>
#4 TRbGlobal<bool>::RebalanceForErase (z=0x574a5d9a8db0, root=<error reading variable>, leftmost=<error reading variable>, rightmost=<error reading variable>) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/containers/intrusive_rb_tree/rb_tree.h +686
#5 TRbTree<NCoro::TContPollEvent, NCoro::TContPollEventCompare>::EraseImpl (this=<optimized out>, val=0x574a5d9a8db0) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/containers/intrusive_rb_tree/rb_tree.h +330
#6 TRbTree<NCoro::TContPollEvent, NCoro::TContPollEventCompare>::TRealNode::UnLink (this=0x574a5d9a8db0) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/containers/intrusive_rb_tree/rb_tree.h +191
#7 NCoro::TContPollEvent::Wake (this=0x574a5d9a8db0) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/coroutine/engine/cont_poller.cpp +26
#8 NCoro::TContPollEvent::Wake (this=0x574a5d9a8db0, status=110) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/coroutine/engine/cont_poller.h +62
#9 NCoro::TEventWaitQueue::WakeTimedout (this=<optimized out>, now=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/coroutine/engine/cont_poller.cpp +40
#10 TContExecutor::WaitForIO (this=0x574a77189600) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/coroutine/engine/impl.cpp +169
#11 TContExecutor::RunScheduler (this=0x574a77189600) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/coroutine/engine/impl.cpp +325
#12 TCont::Switch (this=0x574a585de350) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/coroutine/engine/impl.cpp +76
#13 NCoro::(anonymous namespace)::DoExecuteEvent<TTimerEvent> (event=0x7f0e5f5fa180) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/coroutine/engine/cont_poller.cpp +15
#14 ExecuteEvent (event=0x7f0e5f5fa180) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/coroutine/engine/cont_poller.cpp +69
#15 TCont::SleepD (this=0x574a585de350, deadline=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/coroutine/engine/impl.cpp +72
#16 TContEvent::WaitD (this=0x7f0e5f5fa210, deadline=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/coroutine/engine/events.h +20
#17 TContWaitQueue::WaitD (this=0x7f0e5f5fa1f8, current=0x0, deadline=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/coroutine/engine/events.h +80
#18 TContSimpleEvent::WaitD (this=0x7f0e5f5fa1f8, deadLine=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/coroutine/engine/events.h +134
#19 TContSimpleEvent::WaitI (this=0x7f0e5f5fa1f8) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/coroutine/engine/events.h +142
#20 NCloud::TExecutor::WaitForI<void> (this=<optimized out>, future=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/cloud/storage/core/libs/coroutine/executor.h +108
#21 NCloud::TExecutor::WaitFor (this=0x0, future=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/cloud/storage/core/libs/coroutine/executor.h +65
#22 NCloud::NBlockStore::NServer::(anonymous namespace)::TEndpoint::Start (this=0x574a69c56e50) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/cloud/blockstore/libs/endpoints_vhost/external_vhost_server.cpp +620
#23 NCloud::NBlockStore::NServer::(anonymous namespace)::TExternalVhostEndpointListener::StartExternalEndpoint (this=0x574a7eec1520, epType=NCloud::NBlockStore::NServer::(anonymous namespace)::EEndpointType::Local, request=..., volume=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/cloud/blockstore/libs/endpoints_vhost/external_vhost_server.cpp +1124
#24 NCloud::NBlockStore::NServer::(anonymous namespace)::TExternalVhostEndpointListener::TryStartExternalEndpoint (this=0x574a7eec1520, request=..., volume=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/cloud/blockstore/libs/endpoints_vhost/external_vhost_server.cpp +981
#25 NCloud::NBlockStore::NServer::(anonymous namespace)::TExternalVhostEndpointListener::StartEndpoint (this=0x574a7eec1520, request=..., volume=..., session=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/cloud/blockstore/libs/endpoints_vhost/external_vhost_server.cpp +797
#26 NCloud::NBlockStore::NServer::(anonymous namespace)::TExternalVhostEndpointListener::TrySwitchEndpoint(NCloud::NBlockStore::NProto::TStartEndpointRequest const&, NCloud::NBlockStore::NProto::TVolume const&, std::__y1::shared_ptr<NCloud::NBlockStore::NClient::ISession>)::{lambda(auto:1 const&)#1}::operator()<NThreading::TFuture<NCloud::NProto::TError> >(NThreading::TFuture<NCloud::NProto::TError> const&) const (future=..., this=<optimized out>) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/cloud/blockstore/libs/endpoints_vhost/external_vhost_server.cpp +912
#27 NThreading::TFuture<NCloud::NProto::TError>::Apply<NCloud::NBlockStore::NServer::(anonymous namespace)::TExternalVhostEndpointListener::TrySwitchEndpoint(NCloud::NBlockStore::NProto::TStartEndpointRequest const&, NCloud::NBlockStore::NProto::TVolume const&, std::__y1::shared_ptr<NCloud::NBlockStore::NClient::ISession>)::{lambda(auto:1 const&)#1}>(NCloud::NBlockStore::NServer::(anonymous namespace)::TExternalVhostEndpointListener::TrySwitchEndpoint(NCloud::NBlockStore::NProto::TStartEndpointRequest const&, NCloud::NBlockStore::NProto::TVolume const&, std::__y1::shared_ptr<NCloud::NBlockStore::NClient::ISession>)::{lambda(auto:1 const&)#1}&&) const::{lambda(NThreading::TFuture<NCloud::NProto::TError> const&)#1}::operator()(NThreading::TFuture<NCloud::NProto::TError> const)::{lambda()#1}::operator()() const (this=<optimized out>) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/threading/future/core/future-inl.h +627
#28 NThreading::NImpl::SetValue<NCloud::NProto::TError, NThreading::TFuture<NCloud::NProto::TError>::Apply<NCloud::NBlockStore::NServer::(anonymous namespace)::TExternalVhostEndpointListener::TrySwitchEndpoint(NCloud::NBlockStore::NProto::TStartEndpointRequest const&, NCloud::NBlockStore::NProto::TVolume const&, std::__y1::shared_ptr<NCloud::NBlockStore::NClient::ISession>)::{lambda(auto:1 const&)#1}>(NCloud::NBlockStore::NServer::(anonymous namespace)::TExternalVhostEndpointListener::TrySwitchEndpoint(NCloud::NBlockStore::NProto::TStartEndpointRequest const&, NCloud::NBlockStore::NProto::TVolume const&, std::__y1::shared_ptr<NCloud::NBlockStore::NClient::ISession>)::{lambda(auto:1 const&)#1}&&) const::{lambda(NThreading::TFuture<NCloud::NProto::TError> const&)#1}::operator()(NThreading::TFuture<NCloud::NProto::TError> const)::{lambda()#1}>(NThreading::TPromise<NCloud::NProto::TError>&, NThreading::TFuture<NCloud::NProto::TError>::Apply<NCloud::NBlockStore::NServer::(anonymous namesp
 ace)::TExternalVhostEndpointListener::TrySwitchEndpoint(NCloud::NBlockStore::NProto::TStartEndpointRequest const&, NCloud::NBlockStore::NProto::TVolume const&, std::__y1::shared_ptr<NCloud::NBlockStore::NClient::ISession>)::{lambda(auto:1 const&)#1}>(NCloud::NBlockStore::NServer::(anonymous namespace)::TExternalVhostEndpointListener::TrySwitchEndpoint(NCloud::NBlockStore::NProto::TStartEndpointRequest const&, NCloud::NBlockStore::NProto::TVolume const&, std::__y1::shared_ptr<NCloud::NBlockStore::NClient::ISession>)::{lambda(auto:1 const&)#1}&&) const::{lambda(NThreading::TFuture<NCloud::NProto::TError> const&)#1}::operator()(NThreading::TFuture<NCloud::NProto::TError> const)::{lambda()#1}&&) (promise=..., func=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/threading/future/core/future-inl.h +486
#29 NThreading::TFuture<NCloud::NProto::TError>::Apply<NCloud::NBlockStore::NServer::(anonymous namespace)::TExternalVhostEndpointListener::TrySwitchEndpoint(NCloud::NBlockStore::NProto::TStartEndpointRequest const&, NCloud::NBlockStore::NProto::TVolume const&, std::__y1::shared_ptr<NCloud::NBlockStore::NClient::ISession>)::{lambda(auto:1 const&)#1}>(NCloud::NBlockStore::NServer::(anonymous namespace)::TExternalVhostEndpointListener::TrySwitchEndpoint(NCloud::NBlockStore::NProto::TStartEndpointRequest const&, NCloud::NBlockStore::NProto::TVolume const&, std::__y1::shared_ptr<NCloud::NBlockStore::NClient::ISession>)::{lambda(auto:1 const&)#1}&&) const::{lambda(NThreading::TFuture<NCloud::NProto::TError> const&)#1}::operator()(NThreading::TFuture<NCloud::NProto::TError> const) (this=0x574a68bf4988, future=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/threading/future/core/future-inl.h +627
#30 std::__y1::__function::__value_func<void (NThreading::TFuture<NCloud::NProto::TError> const&)>::operator()[abi:v160005](NThreading::TFuture<NCloud::NProto::TError> const&) const (this=0x574ab8d29d90, __args=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/contrib/libs/cxxsupp/libcxx/include/__functional/function.h +510
#31 std::__y1::function<void (NThreading::TFuture<NCloud::NProto::TError> const&)>::operator()(NThreading::TFuture<NCloud::NProto::TError> const&) const (this=0x574ab8d29d90, __arg=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/contrib/libs/cxxsupp/libcxx/include/__functional/function.h +1156
#32 NThreading::NImpl::TFutureState<NCloud::NProto::TError>::TrySetValue<NCloud::NProto::TError const&> (this=<optimized out>, value=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/threading/future/core/future-inl.h +164
#33 NThreading::NImpl::TFutureState<NCloud::NProto::TError>::SetValue<NCloud::NProto::TError const&> (this=0x0, value=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/threading/future/core/future-inl.h +132
#34 NThreading::TPromise<NCloud::NProto::TError>::SetValue (this=0x574a73d47b48, value=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/library/cpp/threading/future/core/future-inl.h +793
#35 NCloud::NBlockStore::NServer::(anonymous namespace)::TEndpoint::ThreadProc (this=0x574a73d47a30) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/cloud/blockstore/libs/endpoints_vhost/external_vhost_server.cpp +673
#36 NCloud::NBlockStore::NServer::(anonymous namespace)::TEndpoint::Start()::{lambda()#1}::operator()() const (this=<optimized out>) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/cloud/blockstore/libs/endpoints_vhost/external_vhost_server.cpp +614
#37 std::__y1::__invoke[abi:v160005]<NCloud::NBlockStore::NServer::(anonymous namespace)::TEndpoint::Start()::{lambda()#1}> (__f=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/contrib/libs/cxxsupp/libcxx/include/__functional/invoke.h +394
#38 std::__y1::__thread_execute[abi:v160005]<std::__y1::unique_ptr<std::__y1::__thread_struct, std::__y1::default_delete<std::__y1::__thread_struct> >, NCloud::NBlockStore::NServer::(anonymous namespace)::TEndpoint::Start()::{lambda()#1}>(std::__y1::tuple<std::__y1::unique_ptr<std::__y1::__thread_struct, std::__y1::default_delete<std::__y1::__thread_struct> >, NCloud::NBlockStore::NServer::(anonymous namespace)::TEndpoint::Start()::{lambda()#1}>&, std::__y1::__tuple_indices<>) (__t=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/contrib/libs/cxxsupp/libcxx/include/thread +282
#39 std::__y1::__thread_proxy[abi:v160005]<std::__y1::tuple<std::__y1::unique_ptr<std::__y1::__thread_struct, std::__y1::default_delete<std::__y1::__thread_struct> >, NCloud::NBlockStore::NServer::(anonymous namespace)::TEndpoint::Start()::{lambda()#1}> >(std::__y1::tuple<std::__y1::unique_ptr<std::__y1::__thread_struct, std::__y1::default_delete<std::__y1::__thread_struct> >, NCloud::NBlockStore::NServer::(anonymous namespace)::TEndpoint::Start()::{lambda()#1}>) (__vp=<optimized out>) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/contrib/libs/cxxsupp/libcxx/include/thread +293
#40 start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#41 clone () from /lib/x86_64-linux-gnu/libc.so.6

@komarevtsev-d komarevtsev-d linked an issue Sep 14, 2024 that may be closed by this pull request
@komarevtsev-d komarevtsev-d added bug Something isn't working blockstore Add this label to run only cloud/blockstore build and tests on PR labels Sep 14, 2024
Copy link
Contributor

Note

This is an automated comment that will be appended during run.

🟢 linux-x86_64-relwithdebinfo: all tests PASSED for commit 93e6d18.

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
3271 3271 0 0 0 0

@komarevtsev-d komarevtsev-d merged commit ffbc7bc into main Sep 14, 2024
12 of 19 checks passed
@komarevtsev-d komarevtsev-d deleted the users/komarevtsev-d/issue-2013/1 branch September 14, 2024 22:57
komarevtsev-d added a commit that referenced this pull request Sep 16, 2024
komarevtsev-d added a commit that referenced this pull request Sep 17, 2024
* Spawn the vhost-server from special thread (#2014)

* Spawn the vhost-server from special thread

* Make vhost death time easier

* Make the code more coroutiny

* update comment after method renaming (#1955)

* Switch coroutine wait to CondVar (#2032)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blockstore Add this label to run only cloud/blockstore build and tests on PR bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[NBS] The vhost-server can catch erroneous SIGUSR2
3 participants