LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > Ruby/Rails > Strange interference between LSAPI, popen3 and MySQL

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-04-2007, 10:59 AM
andreas andreas is offline
Senior Member
 
Join Date: Aug 2006
Posts: 91
Default Strange interference between LSAPI, popen3 and MySQL

(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.
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:23 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.