aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/zenhttp/httpasio.cpp11
-rw-r--r--src/zenserver/upstream/upstreamcache.cpp2
-rw-r--r--src/zenserver/zenserver.cpp8
4 files changed, 20 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c28d27104..88a36f06a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,7 @@
- Improvement: Added zenserver.exe and zen.exe/zen.pdb to Sentry debug information upload to populate unwind information
- Improvement: Front-end can now be served from a development directory in release mode as well as debug if there's no zipfs attached
- Improvement: Increased retry logic in diskcachelayer when we are denied moving a temporary file into place
+- Improvement: Named some additional background threads for better debug / sentry reporting
- Update: Bump CI VCPKG version to 2023.04.15 and xmake to 2.7.9 (was 2022.08.15 and 2.6.5)
## 0.2.12
diff --git a/src/zenhttp/httpasio.cpp b/src/zenhttp/httpasio.cpp
index b76f3d2e3..8ac36c7f3 100644
--- a/src/zenhttp/httpasio.cpp
+++ b/src/zenhttp/httpasio.cpp
@@ -1250,10 +1250,19 @@ HttpAsioServerImpl::Start(uint16_t Port, int ThreadCount)
m_Acceptor.reset(new asio_http::HttpAcceptor(*this, m_IoService, Port));
m_Acceptor->Start();
+ // This should consist of a set of minimum threads and grow on demand to
+ // meet concurrency needs? Right now we end up allocating a large number
+ // of threads even if we never end up using all of them, which seems
+ // wasteful. It's also not clear how the demand for concurrency should
+ // be balanced with the engine side - ideally we'd have some kind of
+ // global scheduling to prevent one side from preventing the other side
+ // from making progress. Or at the very least, thread priorities should
+ // be considered.
+
for (int i = 0; i < ThreadCount; ++i)
{
m_ThreadPool.emplace_back([this, Index = i + 1] {
- SetCurrentThreadName(fmt::format("asio worker {}", Index));
+ SetCurrentThreadName(fmt::format("asio_io_{}", Index));
try
{
diff --git a/src/zenserver/upstream/upstreamcache.cpp b/src/zenserver/upstream/upstreamcache.cpp
index 9f6a0abc4..01ba626bd 100644
--- a/src/zenserver/upstream/upstreamcache.cpp
+++ b/src/zenserver/upstream/upstreamcache.cpp
@@ -1990,6 +1990,8 @@ private:
void MonitorEndpoints()
{
+ SetCurrentThreadName("upstream_monitor");
+
for (;;)
{
{
diff --git a/src/zenserver/zenserver.cpp b/src/zenserver/zenserver.cpp
index 76aa78f37..363f168fe 100644
--- a/src/zenserver/zenserver.cpp
+++ b/src/zenserver/zenserver.cpp
@@ -536,7 +536,10 @@ public:
{
if (!m_IoRunner.joinable())
{
- m_IoRunner = std::thread{[this] { m_IoContext.run(); }};
+ m_IoRunner = std::thread{[this] {
+ zen::SetCurrentThreadName("timer_io");
+ m_IoContext.run();
+ }};
}
}
@@ -1255,7 +1258,10 @@ ZenEntryPoint::Run()
// Monitor shutdown signals
ShutdownThread.reset(new std::thread{[&] {
+ zen::SetCurrentThreadName("shutdown_monitor");
+
ZEN_INFO("shutdown monitor thread waiting for shutdown signal '{}'", ShutdownEventName);
+
if (ShutdownEvent->Wait())
{
if (!IsApplicationExitRequested())