aws-flow-ruby icon indicating copy to clipboard operation
aws-flow-ruby copied to clipboard

settings forks per worker seems to be broken on windows

Open eoliphan opened this issue 10 years ago • 2 comments

I kept getting errors regarding calls to 'fork()' despite having set number_of_forks_per_worker to 0 per the documentation. I thought the issue was in start_activity_workers(runner.rb), because 'use_forking' isn't set when the local fork_count is 0, but it appears that the error is in the following code in runner.rb. It calls fork regardless of the setting

def self.spawn_and_start_workers(json_fragment, process_name, worker)
        workers = []
        num_of_workers = json_fragment['number_of_workers'] || FlowConstants::NUM_OF_WORKERS_DEFAULT
        should_register = true
        num_of_workers.times do
          workers << fork do
            set_process_name(process_name)
            worker.start(should_register)
          end
          should_register = false
        end
        workers
      end

eoliphan avatar Jul 17 '15 05:07 eoliphan

So, as per the docs, it absolutely should work with number_of_forks_per_worker set to 0. I'll address that in my fork shortly. If this is currently a blocker for you (though given the latency I wouldn't be surprised if not), it is possible to use write/plug in a different executor, or simply have a ruby process which calls worker.start.

mjsteger avatar Oct 05 '15 23:10 mjsteger

Did anything happen with this? I'm developing with aws-flow-ruby in a mixed windows/mac/linux environment, and disappointed that running workers / deciders on Windows doesn't work straightforwardly.

I'll look at using Cygwin, but would be great if there's a patch available to fix this.

SteveAlexander avatar Jun 21 '16 11:06 SteveAlexander