(I have cross-posted this question to ruby-lang: http://www.ruby-forum.com/topic/99988)
I am experiencing a very strange problem in my Rails app. I use popen3
to execute an external program. Everything works fine in Mongrel, but
when I use the app with LSAPI, after popen3 all MySQL queries fail with
"Mysql::Error (MySQL server has gone away)". Once I comment out popen3
it works fine again.
The problem is easy to reproduce in any Rails app using LSAPI and MySQL.
Add the following to a controller action:
require 'open3'
Open3.popen3('/usr/bin/ls') {|stdout, stdin, stderr| stdin.read }
The stdin.read is important.
I am experiencing a very strange problem in my Rails app. I use popen3
to execute an external program. Everything works fine in Mongrel, but
when I use the app with LSAPI, after popen3 all MySQL queries fail with
"Mysql::Error (MySQL server has gone away)". Once I comment out popen3
it works fine again.
The problem is easy to reproduce in any Rails app using LSAPI and MySQL.
Add the following to a controller action:
require 'open3'
Open3.popen3('/usr/bin/ls') {|stdout, stdin, stderr| stdin.read }
The stdin.read is important.