Skip to content

Commit ebdf617

Browse files
bmehta001Copilot
andcommitted
Log pending task counts before shutdown join/detach
Restores visibility into dropped work that was lost when the old LOG_WARN on non-empty queues was removed. Logs queue sizes before the join/detach decision so operators can see pending tasks in both code paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 651583d commit ebdf617

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

lib/pal/WorkerThread.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ namespace PAL_NS_BEGIN {
5353

5454
void Join() final
5555
{
56+
// Log pending work before shutdown so operators can see if
57+
// tasks are being dropped.
58+
if (!m_queue.empty()) {
59+
LOG_WARN("Shutdown with %zu queued task(s) pending", m_queue.size());
60+
}
61+
if (!m_timerQueue.empty()) {
62+
LOG_WARN("Shutdown with %zu timer(s) pending", m_timerQueue.size());
63+
}
5664
auto item = new WorkerThreadShutdownItem();
5765
Queue(item);
5866
std::thread::id this_id = std::this_thread::get_id();

0 commit comments

Comments
 (0)