From cb82d7b081105dc4d6277ac93b67ce76a5287283 Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Tue, 9 Dec 2014 10:22:07 -0800 Subject: [PATCH] Fix #434 Summary: Why do we assert here? This doesn't seem like user friendly thing to do :) Test Plan: none Reviewers: sdong, yhchiang, rven Reviewed By: rven Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D30027 --- util/env_posix.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util/env_posix.cc b/util/env_posix.cc index 039e79c4a1..30997a904a 100644 --- a/util/env_posix.cc +++ b/util/env_posix.cc @@ -1694,11 +1694,10 @@ class PosixEnv : public Env { } if (num > total_threads_limit_ || (num < total_threads_limit_ && allow_reduce)) { - total_threads_limit_ = num; + total_threads_limit_ = std::max(1, num); WakeUpAllThreads(); StartBGThreads(); } - assert(total_threads_limit_ > 0); PthreadCall("unlock", pthread_mutex_unlock(&mu_)); }