reduce pubsub/liveupdates pubsub clients "wait for clean exit" time from 1s to 100ms (#6019)

This commit is contained in:
pajlada
2025-03-02 17:22:31 +01:00
committed by GitHub
parent 58859d439c
commit 706e65cd1e
3 changed files with 7 additions and 6 deletions
+1
View File
@@ -49,6 +49,7 @@
- Dev: Updated `googletest` to 1.16.0. (#5942)
- Dev: Fixed duplicate CMake configure in clean builds. (#5940)
- Dev: BTTV emotes are now loaded as WEBP. (#5957)
- Dev: Reduced time we wait for PubSub connections to cleanly exit from 1s to 100ms. (#6019)
- Dev: Added snapshot tests for EventSub. (#5965)
## 2.5.2
@@ -159,16 +159,16 @@ public:
// There is a case where a new client was initiated but not added to the clients list.
// We just don't join the thread & let the operating system nuke the thread if joining fails
// within 1s.
if (this->stoppedFlag_.waitFor(std::chrono::seconds{1}))
if (this->stoppedFlag_.waitFor(std::chrono::milliseconds{100}))
{
this->mainThread_->join();
return;
}
qCWarning(chatterinoLiveupdates)
<< "Thread didn't finish within 1 second, force-stop the client";
<< "Thread didn't finish within 100ms, force-stop the client";
this->websocketClient_.stop();
if (this->stoppedFlag_.waitFor(std::chrono::milliseconds{100}))
if (this->stoppedFlag_.waitFor(std::chrono::milliseconds{20}))
{
this->mainThread_->join();
return;
+3 -3
View File
@@ -596,16 +596,16 @@ void PubSub::stop()
// within 1s.
// We could fix the underlying bug, but this is easier & we realistically won't use this exact code
// for super much longer.
if (this->stoppedFlag_.waitFor(std::chrono::seconds{1}))
if (this->stoppedFlag_.waitFor(std::chrono::milliseconds{100}))
{
this->thread->join();
return;
}
qCWarning(chatterinoLiveupdates)
<< "Thread didn't finish within 1 second, force-stop the client";
<< "Thread didn't finish within 100ms, force-stop the client";
this->websocketClient.stop();
if (this->stoppedFlag_.waitFor(std::chrono::milliseconds{100}))
if (this->stoppedFlag_.waitFor(std::chrono::milliseconds{20}))
{
this->thread->join();
return;