[Dbix-class] Connection timeouts?

Bill Moseley moseley at hank.org
Fri Oct 10 04:37:16 GMT 2014


On Thu, Oct 9, 2014 at 6:32 PM, Ben Tilly <btilly at gmail.com> wrote:

> The obvious thing to try is to use the alarm() function to send
> yourself a signal and set a signal handler that will just die to
> escape.  But this is unlikely to work due to safe signals.  Search for
> "Safe Signals" in perldoc perlipc for details.  It will also show you
> how to use the POSIX module to set a signal handler that can work
> despite that.
>

But where?   Set storage_type and override/wrap the private method _connect
or _populate_dbh?  I'm wondering what's a good place to hook into.






>
> On Thu, Oct 9, 2014 at 4:33 PM, Bill Moseley <moseley at hank.org> wrote:
> > Any suggestions how to set a connection timeout connections?
> >
> > I'm using the Replicated storage.   If there's a single slave configured
> and
> > it's not running (listening on a socket) DBIC will return quickly and
> fall
> > back to using the master.
> >
> > But, if the slave is listening but not responding then DBIC will hang
> > waiting on a response.   This can be demonstrated by using netcat to
> listen
> > to port and configure the slave to connect there.
> >
> >
> >
> > --
> > Bill Moseley
> > moseley at hank.org
> >
> > _______________________________________________
> > List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> > IRC: irc.perl.org#dbix-class
> > SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> > Searchable Archive:
> > http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
> http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
>



-- 
Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20141009/2203a341/attachment.htm>


More information about the DBIx-Class mailing list