[Backgroundrb-devel] A fix for bdrb crash when running in background
gethemant at gmail.com
Wed Jun 18 13:32:20 EDT 2008
On Wed, Jun 18, 2008 at 6:34 PM, Wojciech Knapik
<webmaster at wolniartysci.pl> wrote:
> Hi everyone
> I just spent way too much time trying to figure out why the fsck bdrb
> wouldn't run in background (while it worked perfecly in foreground), so I
> figured I'll share my unimpressive solution to save others the trouble.
> So the problem was that bdrb, when started with `script/backgroundrb
> start`, would exit, with this error msg:
> `log': PGError: server closed the connection unexpectedly
> This probably means the server terminated abnormally
> before or while processing the request.
> : SELECT tablename
> FROM pg_tables
> WHERE schemaname IN (E'"$user"',E'public')
> Starting it with `script/backgroundrb` didn't cause that problem,
> everything worked fine.
> This happened exactly the same way on a G5/OSX/Postgres 8.2.4/Rails 2.0.2
> workstation and a Xeon/Gentoo/Postgres 8.3.1/Rails 2.0.2 server. Considering
> the different setups and the complete lack of complaints from Postgres, even
> with highest logging verbosity AND the smoothly working rails app, I figured
> it must be a problem with backgroundrb, but whatever changes I tried,
> nothing worked. So fast forward (to spare you the story of the cursing and
> the hopeless googling) - here's the solution - line 32 of
> 29 case ARGV
> 30 when 'start'
> 31 if fork
> 32 sleep(5)
> 33 exit
> 34 else
> Apparently leaving the child on it's own too early is not a good thing :-o
> So there. Here's my good deed for the day.
Damn right! Thanks man.
Let them talk of their oriental summer climes of everlasting
conservatories; give me the privilege of making my own summer with my
More information about the Backgroundrb-devel