Skip to content

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

Log about threadpoool exhuastion.

Kishore Nallande413783c849
diff --git a/include/threadpool.h b/include/threadpool.h
index 6382ebd6..d4b939a2 100644
--- a/include/threadpool.h
+++ b/include/threadpool.h
@@ -5,6 +5,7 @@
#include <functional>
#include <future>
#include <queue>
+#include "logger.h"
class ThreadPool {
public:
@@ -76,6 +77,10 @@ decltype(auto) ThreadPool::enqueue(F&& f, Args&&... args)
// don't allow enqueueing after stopping the pool
if(!stop) {
+ if(tasks.size() >= workers.size()) {
+ LOG(WARNING) << "Threadpool exhaustion detected, task_queue_len: "
+ << tasks.size() << ", thread_pool_len: " << workers.size();
+ }
tasks.emplace(std::move(task));
}
}