Skip to content

Commit

Permalink
Merge pull request #1635 from skalenetwork/bug/IS-256-sigsegv-in-queue
Browse files Browse the repository at this point in the history
SIGSEGV in skale_stats
  • Loading branch information
DmytroNazarenko authored Sep 15, 2023
2 parents 268cd9f + ff4781e commit 17cacb4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libskutils/include/skutils/stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class element : public skutils::ref_retain_release {
element( const char* strSubSystem, const char* strProtocol, const char* strMethod,
int /*nServerIndex*/, int /*ipVer*/ );
virtual ~element();
void stop() const;
void stop();
void setMethod( const char* strMethod ) const;
void setError() const;
double getDurationInSeconds() const;
Expand Down
4 changes: 2 additions & 2 deletions libskutils/src/stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ element::element( const char* strSubSystem, const char* strProtocol, const char*
strProtocol_ = "N/A";
if ( strMethod_.empty() )
strMethod_ = g_strMethodNameUnknown;
do_register();
}
element::~element() {
stop();
Expand All @@ -420,12 +419,13 @@ void element::do_unregister() {
queue::getQueueForSubsystem( strSubSystem_.c_str() ).do_unregister( rttElement );
}

void element::stop() const {
void element::stop() {
lock_type lock( mtx() );
if ( isStopped_ )
return;
isStopped_ = true;
tpEnd_ = skutils::stats::clock::now();
do_register();
}

void element::setMethod( const char* strMethod ) const {
Expand Down

0 comments on commit 17cacb4

Please sign in to comment.