Threadpool grows by negative amount when max_threads = 0

Bug #1095077 reported by Nick Groenen
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Rocket Web Server

Bug Description

While playing around with Rocket, I noticed my threadpool wasn't growing
when I had max_threads set to 0, which should indicate there's no upper
boundary on the maximum number of threads it may create.

I tracked this down to a piece of code in grow() which ensures it never
grows beyond it's max_threads, but didn't take into consideration what
would happen with max_threads set to 0.

I fixed this here:

(I added a line of comment as well because the first time I saw that line
of code, it wasn't clear to me what it's purpose was.)

I did look at the unit tests, but couldn't see a quick way to test for this
use case, so I'll leave that up to another taker. :)

Setting max_threads to 0 there without this commit causes 3 test failures
though, after my commit, only 1 test failure remains.

Nick Groenen (zoni)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.