On Tue, Jan 6, 2015 at 12:45 AM, Jeremy Evans <[email protected]> wrote:
> On Monday, January 5, 2015 2:17:35 AM UTC-8, Lin Jen-Shin wrote:
>> The other thing I am wondering, we're also using
>> ActiveRecord, why we didn't see errors for them?
>
>
> I'm not sure.  Are you trying any hacks to share the connection pool between
> Sequel and ActiveRecord (I know some users are doing this, but it's pretty
> unsafe)?  Assuming not, it's possible that ActiveRecord automatically
> reconnects.  Sequel does not because it isn't safe to do in the general
> case.

Surely not, and I don't understand why one would want to do this?
To reduce the number of connections to database? We're not hitting
connections limits for now, and I would probably try pgBouncer first.
(Frankly I don't know why PostgreSQL has such hard limit on connections)

I would guess ActiveRecord would try to reconnect, or, I really did
something wrong which caused Sequel to have broken connections :(

> You can use the connection_validator extension to check for valid
> connections before using them. This will automatically disconnect and create
> a new connection if the connection is not valid, since it does it at a point
> where it is known to be safe (directly after connection checkout).

Great, actually I was once thinking to do this by myself, but digging
in the source,
I didn't find a proper place to do this. Can we also put some logging for this?
Once this is sorted out, I would like to remove this in case of hiding
another issue.

Will check how to do this tomorrow. Thank you!

> If you are able to create a self-contained reproducible example, please post
> it and I'll investigate.
>
> Thanks,
> Jeremy

That would be wonderful. Thank you very much for the help.

Cheers,

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to