kares / jruby-rack-worker

Thread-ed Background Workers on top of JRuby::Rack
Apache License 2.0
53 stars 15 forks source link

Delayed job sends duplicate emails with Tomcat's parallel deployements #18

Open nasa42 opened 8 years ago

nasa42 commented 8 years ago

We are using Tomcat parallel deployment feature (https://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Parallel_deployment), and we have noticed that Delayed Job will send duplicate emails if there are more than one deployments of the same project in parallel.

Not entirely sure but seems like Delayed Job locking is bypassed because threads in different processes get the same name? https://github.com/kares/jruby-rack-worker/blob/master/src/main/ruby/delayed/jruby_worker.rb#L12

kares commented 8 years ago

sounds like you know the issue and can work around it - for me its been a while and it will take me some to get into the DJ's internals. what name do they get than, is it different from the default? maybe provide a sample (or test) case that passes with DJ's multi-process architecture but fails with multi deploys ...

nasa42 commented 8 years ago

How do you build the gem? I'm trying to fix it in my fork but found no jruby-rack-worker.gemspec file.