Skip to content

Throw exception instead of calling exit(1) in TBasicServicesInitializer #11422

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

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

SvartMetal
Copy link

@SvartMetal SvartMetal commented Nov 8, 2024

Changelog entry

Objects with thread storage duration are guaranteed to be destroyed only for the thread which calls exit.
Therefore there is no guarantee that destruction will happen for objects associated with other threads.
This may cause the blockstore-server to crash as described below:

VERIFY failed (2024-11-06T16:40:28.177019Z):
 
  cloud/storage/core/libs/grpc/init.cpp:29
 
  ~TGrpcState(): requirement AtomicGet(Counter) == 0 failed
 
 
Core was generated by `/usr/bin/blockstore-server --temporary-server --server-port 9771 --secure-serve'.
#0 0x00007fb7366d100b in raise () from /lib/x86_64-linux-gnu/libc.so.6
[Current thread is 491 (LWP 1258357)]
 
Thread 491 (LWP 1258357):
#0 raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 abort () from /lib/x86_64-linux-gnu/libc.so.6
#2 NPrivate::InternalPanicImpl (line=<optimized out>, function=0x55da62d049f3 "~TGrpcState", expr=<optimized out>, file=..., errorMessage=0x55da638902c9 <NULL_STRING_REPR+9> "", errorMessageSize=0) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/util/system/yassert.cpp +90
#3 NPrivate::Panic (file=..., line=29, function=0x55da62d049f3 "~TGrpcState", expr=0x55da62b799dc "AtomicGet(Counter) == 0", format=<optimized out>) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/util/system/yassert.cpp +55
#4 NCloud::(anonymous namespace)::TGrpcState::~TGrpcState (this=<optimized out>) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/cloud/storage/core/libs/grpc/init.cpp +29
#5 NPrivate::Destroyer<NCloud::(anonymous namespace)::TGrpcState> (ptr=<optimized out>) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/util/generic/singleton.h +23
#6 (anonymous namespace)::TAtExit::Finish (this=0x55da807b5c40 <(anonymous namespace)::atExitMem>) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/util/system/atexit.cpp +56
#7 (anonymous namespace)::OnExit () at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/util/system/atexit.cpp +93
#8 ?? () from /lib/x86_64-linux-gnu/libc.so.6
#9 exit () from /lib/x86_64-linux-gnu/libc.so.6
#10 NKikimr::NKikimrServicesInitializers::TBasicServicesInitializer::InitializeServices (this=0x149f3e32b930, setup=0x149f3e0c0000, appData=0x149f3ee01340) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/contrib/ydb/core/driver_lib/run/kikimr_services_initializers.cpp +828
#11 NKikimr::TServiceInitializersList::InitializeServices (this=<optimized out>, setup=0x149f3e0c0000, appData=0x149f3ee01340) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/contrib/ydb/core/driver_lib/run/service_initializer.cpp +13
#12 NKikimr::TKikimrRunner::InitializeActorSystem (this=0x149f3fa4c600, runConfig=..., serviceInitializers=..., servicesMask=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/contrib/ydb/core/driver_lib/run/run.cpp +1279
#13 NCloud::NBlockStore::NStorage::TActorSystem::Init (this=0x149f3fa4c600) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/cloud/blockstore/libs/storage/init/common/actorsystem.cpp +60
#14 NCloud::NBlockStore::NStorage::CreateActorSystem (sArgs=...) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/cloud/blockstore/libs/storage/init/server/actorsystem.cpp +576
#15 NCloud::NBlockStore::NServer::TBootstrapYdb::InitKikimrService (this=0x7ffc1f153b00) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/cloud/blockstore/libs/daemon/ydb/bootstrap.cpp +571
#16 NCloud::NBlockStore::NServer::TBootstrapBase::Init (this=0x7ffc1f153b00) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/cloud/blockstore/libs/daemon/common/bootstrap.cpp +225
#17 NCloud::DoMain<NCloud::NBlockStore::NServer::TBootstrapYdb> (bootstrap=..., argc=59, argv=0x7ffc1f1540c8) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/cloud/storage/core/libs/daemon/app.h +36
#18 main (argc=59, argv=0x7ffc1f1540c8) at /opt/buildagent/work/4ec98910e7de170b/__FUSE/mount_path/cloud/nbs_internal/blockstore/daemon/main.cpp +135
...

Changelog category

  • Bugfix

Additional information

...

@github-actions github-actions bot added the bugfix label Nov 8, 2024
@SvartMetal SvartMetal force-pushed the users/svartmetal/fix/1 branch from a927cda to afee72d Compare November 8, 2024 15:15
@SvartMetal SvartMetal force-pushed the users/svartmetal/fix/1 branch from afee72d to 022958a Compare November 8, 2024 15:16
@github-actions github-actions bot added bugfix and removed bugfix labels Nov 8, 2024
Copy link

github-actions bot commented Nov 8, 2024

2024-11-08 15:18:22 UTC Pre-commit check linux-x86_64-relwithdebinfo for 2ed73ea has started.
2024-11-08 15:18:33 UTC Artifacts will be uploaded here
2024-11-08 15:21:38 UTC ya make is running...
🟡 2024-11-08 16:11:05 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
16565 15060 0 1 1404 100

2024-11-08 16:12:41 UTC ya make is running... (failed tests rerun, try 2)
🟢 2024-11-08 16:30:01 UTC Tests successful.

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
100 (only retried tests) 5 0 0 0 95

🟢 2024-11-08 16:30:08 UTC Build successful.
🟢 2024-11-08 16:30:27 UTC ydbd size 2.8 GiB changed* by +19.0 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: 65dc86e merge: 2ed73ea diff diff %
ydbd size 3 046 533 848 Bytes 3 046 553 320 Bytes +19.0 KiB +0.001%
ydbd stripped size 482 199 064 Bytes 482 204 056 Bytes +4.9 KiB +0.001%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link

github-actions bot commented Nov 8, 2024

2024-11-08 15:18:59 UTC Pre-commit check linux-x86_64-release-asan for 2ed73ea has started.
2024-11-08 15:19:11 UTC Artifacts will be uploaded here
2024-11-08 15:22:19 UTC ya make is running...
🟡 2024-11-08 16:33:05 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
10182 10108 0 25 9 40

🟢 2024-11-08 16:34:04 UTC Build successful.
🟢 2024-11-08 16:34:35 UTC ydbd size 5.7 GiB changed* by +22.4 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: 9fb36d1 merge: 2ed73ea diff diff %
ydbd size 6 165 188 032 Bytes 6 165 210 984 Bytes +22.4 KiB +0.000%
ydbd stripped size 1 537 405 616 Bytes 1 537 418 544 Bytes +12.6 KiB +0.001%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@va-kuznecov va-kuznecov merged commit 30b722c into ydb-platform:main Nov 8, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants