El Sábado, 5 de Septiembre de 2009, Iñaki Baz Castillo escribió:
> El Sábado, 5 de Septiembre de 2009, Iñaki Baz Castillo escribió:
> > El Sábado, 5 de Septiembre de 2009, Jeremy Evans escribió:
> > > On Sep 4, 2:41 pm, Iñaki Baz Castillo <[email protected]> wrote:
> > > > Ok, I've added a "begin, rescue" in the Rack #call method so now I
> > > > see the exception. There I see Sequel::DatabaseConnectionError.
> > > >
> > > > However, I still wonder how to detect that a prepared stament has
> > > > been lost due to a DB server restart...
> > > >
> > > > Thanks a lot.
> > >
> > > The patch at http://pastie.org/606419.txt should fix this error.
> >
> > Applied, but still happens:
> >
> >   Mysql::Error: Can't connect to local MySQL server through socket
> >   '/var/run/mysqld/mysqld.sock' (2)
> 
> I think it occurs when I call to ps#call (prepared stament) while the MySQL
>  is restarting/stopped.

Yes, the bug must be there. Please note what me app logs say:


- I run my app so DB.set is called:

I 2009-09-05 01:00:03 [6441]  INFO : Setting DB prepared staments
D 2009-09-05 01:00:03 [6441] DEBUG : DB: ds_get_document.prepare 
I 2009-09-05 01:00:03 [6441]  INFO : Done


- At this point my app is running as well MySQL. A request arrives so my app 
does a select using the prepared stament.

D 2009-09-05 01:00:26 [6441] DEBUG : DB: ps_get_document.call


- Now I stop MySQL. A new request arrives:

D 2009-09-05 01:00:35 [6441] DEBUG : DB: ps_get_document.call
F 2009-09-05 01:00:35 [6441] FATAL : Mysql::Error: Can't connect to local 
MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)


- I rescue the error (any error for now) so call again to DB.set:

I 2009-09-05 01:00:35 [6441]  INFO : Setting DB prepared staments               
                                          
D 2009-09-05 01:00:35 [6441] DEBUG : DB: ds_get_document.prepare
I 2009-09-05 01:00:35 [6441]  INFO : Done


- MySQL still down and a new request arrives:

D 2009-09-05 01:00:44 [6441] DEBUG : DB: ps_get_document.call
F 2009-09-05 01:00:44 [6441] FATAL : Sequel::DatabaseConnectionError: 
Mysql::Error Can't connect to local MySQL server through socket 
'/var/run/mysqld/mysqld.sock' (2)


- Again DB.set is called.

I 2009-09-05 01:00:44 [6441]  INFO : Setting DB prepared staments
D 2009-09-05 01:00:44 [6441] DEBUG : DB: ds_get_document.prepare
I 2009-09-05 01:00:44 [6441]  INFO : Done


- MySQL is up again. A new request arrives (and now it works):

D 2009-09-05 01:00:55 [6441] DEBUG : DB: ps_get_document.call




-- 
Iñaki Baz Castillo <[email protected]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to