On Dec 28, 3:12 pm, Iñaki Baz Castillo <[email protected]> wrote:
> Hi, very good news about the 'pg' driver (I open a new thread as the previous
> one was invalid).
>
> After I've reported the bug, developers of 'pg' have confirmed it:
>
> "Well, I was going to reply that the 'pg' library has an interface explicitly
> for doing non-blocking connects (PGconn.connect_start/connect_poll), but when
> I added a case to demonstrate this to the test case you attached, it blocked
> anyway! It turns out that .connect_start has had a bug in it since it was
> written. I'll commit the fix for that shortly"
>
> And the fix is already available:
>
> http://bitbucket.org/ged/ruby-pg/issue/14/pgconnconnect-blocks-foreve...
> db-host-ishttp://bitbucket.org/ged/ruby-pg/changeset/f5af71167dea/
>
> But this requires the usage of a different method for connection. See a
> working example:
>
>  http://bitbucket.org/m/attch/2009/12/test_ruby_db_drivers_block_in_co...
>
> Could it be implemented in Sequel so 'pg' would be non-blocking for
> connections?

It probably could, but Sequel's postgres adapter supports postgres and
postgres-pr in addition to pg (not to mention previous versions of
pg), and backwards compatibility for those must be kept.  As the
connect_poll method exists in previous versions of pg, but is broken,
I don't think Sequel can support it until a new version of pg is
released.  After a new version of pg is released, if the version of pg
being used can be checked, you could conditionally use the
connect_poll in the adapter's connect method if pg is being used and
the pg version properly supports it.

Jeremy

--

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