Skip to content

Commit ce7bce7

Browse files
author
babenko
committed
YT-24705: Revert crash lock
commit_hash:d0346b43e4fb158b5a1b5be079772d6a00587d86
1 parent f863fb8 commit ce7bce7

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

yt/yt/core/misc/crash_handler.cpp

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,6 @@ void WriteToStderr(const char* buffer)
7878

7979
namespace NDetail {
8080

81-
constinit NThreading::TSpinLock CrashLock;
82-
constinit YT_DEFINE_THREAD_LOCAL(bool, CrashLockAcquiredByCurrentThread);
83-
84-
void AcquireCrashLock()
85-
{
86-
if (!std::exchange(CrashLockAcquiredByCurrentThread(), true)) {
87-
CrashLock.Acquire();
88-
}
89-
}
90-
91-
void ReleaseCrashLock()
92-
{
93-
if (std::exchange(CrashLockAcquiredByCurrentThread(), false)) {
94-
CrashLock.Release();
95-
}
96-
}
97-
9881
Y_NO_INLINE TStackTrace GetStackTrace(TStackTraceBuffer* buffer)
9982
{
10083
#ifdef _unix_
@@ -533,16 +516,10 @@ void AssertTrapImpl(
533516

534517
MaybeThrowSafeAssertionException(formatter.GetBuffer());
535518

536-
// Prevent clashes in stderr.
537-
AcquireCrashLock();
538-
539519
WriteToStderr(formatter.GetBuffer());
540520

541521
// This (hopefully) invokes CrashSignalHandler.
542522
YT_BUILTIN_TRAP();
543-
544-
// Not expected to get here but anyway...
545-
ReleaseCrashLock();
546523
}
547524

548525
} // namespace NDetail
@@ -560,9 +537,6 @@ void CrashSignalHandler(int /*signal*/, siginfo_t* si, void* uc)
560537
::signal(SIGALRM, NDetail::CrashTimeoutHandler);
561538
::alarm(60);
562539

563-
// Prevent clashes in stderr.
564-
NDetail::AcquireCrashLock();
565-
566540
NDetail::DumpTimeInfo();
567541

568542
NDetail::DumpCodicils();
@@ -576,9 +550,6 @@ void CrashSignalHandler(int /*signal*/, siginfo_t* si, void* uc)
576550

577551
NDetail::DumpUndumpableBlocksInfo();
578552

579-
// Releasing the lock gives other threads a chance to yell at us.
580-
NDetail::ReleaseCrashLock();
581-
582553
WriteToStderr("*** Waiting for logger to shut down\n");
583554

584555
NLogging::TLogManager::Get()->Shutdown();

0 commit comments

Comments
 (0)