Skip to content

ActionPool#process ignores max_threads limit #3

@truekonrads

Description

@truekonrads

Hello,

It appears that when I specify max_threads and keep adding new tasks using ActionPool#process, ActionPool keeps spawini ng new tasks. My code can be summarised as this:

pool = ActionPool::Pool.new(:min_threads => 1, :max_threads => 5)
Dir.entries(targetdir).each {|fe|
   pool.process do
    process(fe)
   end
 end

After about processing 160 tasks, I get an error "can't allocate thread" suggesting that ruby has ran out of threads. This is not a problem in a single-thread version of the program.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions