You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I hope that I'm wrong, but at the moment this looks like a serious bug to me, but maybe I just didn't do enough RTFM. I found this bug when using ActionMailer with sendmail. The "/usr/sbin/sendmail" process was only sometimes called and sometimes it wasn't (most often it wasn't but around every tenth time it suddenly worked)
I investigated it deeply and after hours I distilled it down to the following:
As one can see, the system call on both Ruby Interpreters waits until the subprocess exits. But with MRI it also stops when using IO.popen, but not with JRuby. Here it returns immediately.
I found a very ugly workaround for the moment by doing something like the following:
module ActionMailer
class Base
def perform_delivery_sendmail(mail)
sendmail_args = sendmail_settings[:arguments]
sendmail_args += " -f \"#{mail['return-path']}\"" if mail['return-path']
IO.popen("#{sendmail_settings[:location]} #{sendmail_args}", "r+") do |f| #r+ geht, w+ geht nicht richtig, bzw. nur manchmal
f.puts mail.encoded.gsub(/\r/, '')
f.close_write
sleep 1 # <---- added this line in order to give sendmail some time to process
end
end
end
end
{noformat}
Here are some environment infos:
{noformat}
hk@hk:~$ rvm info jruby
jruby-1.6.5:
system:
uname: "Linux hk 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux"
bash: "/bin/bash => GNU bash, Version 4.2.10(1)-release (x86_64-pc-linux-gnu)"
zsh: " => not installed"
rvm:
version: "rvm 1.9.0 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]"
ruby:
interpreter: "jruby"
version: "1.6.5"
date: "2011-10-25"
platform: "linux-amd64-java"
patchlevel: "OpenJDK 64-Bit Server VM 1.6.0_23"
full_version: "jruby 1.6.5 (ruby-1.8.7-p330) (2011-10-25 9dcd388) (OpenJDK 64-Bit Server VM 1.6.0_23) [linux-amd64-java]"
homes:
gem: "/home/hk/.rvm/gems/jruby-1.6.5"
ruby: "/home/hk/.rvm/rubies/jruby-1.6.5"
binaries:
ruby: "/home/hk/.rvm/rubies/jruby-1.6.5/bin/ruby"
irb: "/home/hk/.rvm/rubies/jruby-1.6.5/bin/irb"
gem: "/home/hk/.rvm/rubies/jruby-1.6.5/bin/gem"
rake: "/home/hk/.rvm/gems/jruby-1.6.5/bin/rake"
environment:
PATH: "/home/hk/.rvm/gems/jruby-1.6.5/bin:/home/hk/.rvm/gems/jruby-1.6.5@global/bin:/home/hk/.rvm/rubies/jruby-1.6.5/bin:/home/hk/.rvm/bin:<other stuff>"
GEM_HOME: "/home/hk/.rvm/gems/jruby-1.6.5"
GEM_PATH: "/home/hk/.rvm/gems/jruby-1.6.5:/home/hk/.rvm/gems/jruby-1.6.5@global"
MY_RUBY_HOME: "/home/hk/.rvm/rubies/jruby-1.6.5"
IRBRC: "/home/hk/.rvm/rubies/jruby-1.6.5/.irbrc"
RUBYOPT: ""
gemset: ""
hk@hk:~$
hk@hk:~$ rvm info 1.8.7
ruby-1.8.7-p352:
system:
uname: "Linux hk 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux"
bash: "/bin/bash => GNU bash, Version 4.2.10(1)-release (x86_64-pc-linux-gnu)"
zsh: " => not installed"
rvm:
version: "rvm 1.9.0 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]"
ruby:
interpreter: "ruby"
version: "1.8.7"
date: "2011-06-30"
platform: "x86_64-linux"
patchlevel: "2011-06-30 patchlevel 352"
full_version: "ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]"
homes:
gem: "/home/hk/.rvm/gems/ruby-1.8.7-p352"
ruby: "/home/hk/.rvm/rubies/ruby-1.8.7-p352"
binaries:
ruby: "/home/hk/.rvm/rubies/ruby-1.8.7-p352/bin/ruby"
irb: "/home/hk/.rvm/rubies/ruby-1.8.7-p352/bin/irb"
gem: "/home/hk/.rvm/rubies/ruby-1.8.7-p352/bin/gem"
rake: "/home/hk/.rvm/gems/ruby-1.8.7-p352/bin/rake"
environment:
PATH: "/home/hk/.rvm/gems/ruby-1.8.7-p352/bin:/home/hk/.rvm/gems/ruby-1.8.7-p352@global/bin:/home/hk/.rvm/rubies/ruby-1.8.7-p352/bin:<other stuff>"
GEM_HOME: "/home/hk/.rvm/gems/ruby-1.8.7-p352"
GEM_PATH: "/home/hk/.rvm/gems/ruby-1.8.7-p352:/home/hk/.rvm/gems/ruby-1.8.7-p352@global"
MY_RUBY_HOME: "/home/hk/.rvm/rubies/ruby-1.8.7-p352"
IRBRC: "/home/hk/.rvm/rubies/ruby-1.8.7-p352/.irbrc"
RUBYOPT: ""
gemset: ""
hk@hk:~$
The text was updated successfully, but these errors were encountered:
NOTE: Originally filed as http://jira.codehaus.org/browse/JRUBY-6162
Hi,
I hope that I'm wrong, but at the moment this looks like a serious bug to me, but maybe I just didn't do enough RTFM. I found this bug when using ActionMailer with sendmail. The "/usr/sbin/sendmail" process was only sometimes called and sometimes it wasn't (most often it wasn't but around every tenth time it suddenly worked)
I investigated it deeply and after hours I distilled it down to the following:
As one can see, the system call on both Ruby Interpreters waits until the subprocess exits. But with MRI it also stops when using IO.popen, but not with JRuby. Here it returns immediately.
I found a very ugly workaround for the moment by doing something like the following:
The text was updated successfully, but these errors were encountered: