← Back to team overview

linux-traipu team mailing list archive

[Bug 879027] [NEW] libdrizzle: failed non-blocking connects do not report error

 

Public bug reported:

1. Use an external event loop with libdrizzle
2. Try to connect to a non-existent server.
3. The connect will succeed, but the next operation will fail.

The problem is that libdrizzle assumes the event loop will set POLLERR
if the non-blocking connect fails. However, libdrizzle only ever passes
POLLOUT to drizzle_con_set_events, and thus the external event loop
never knows it should watch for errors. Worse, libevent, probably the
most popular event loop library, never sets error indicators, and only
ever sets the equivalent of POLLIN and POLLOUT. The reason, as far as I
can tell, is that some polling mechanisms don't return error
indications{

The attached patch fixes this by checking getsockopt to see if the
connect succeeded or failed. I haven't tested this in libdrizzle itself
(I maintain my own copy in my project), but this works for me. Thanks!

** Affects: drizzle
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of UBUNTU -
AL - BR, which is subscribed to Drizzle.
https://bugs.launchpad.net/bugs/879027

Title:
  libdrizzle: failed non-blocking connects do not report error

Status in A Lightweight SQL Database for Cloud Infrastructure and Web Applications:
  New

Bug description:
  1. Use an external event loop with libdrizzle
  2. Try to connect to a non-existent server.
  3. The connect will succeed, but the next operation will fail.

  The problem is that libdrizzle assumes the event loop will set POLLERR
  if the non-blocking connect fails. However, libdrizzle only ever
  passes POLLOUT to drizzle_con_set_events, and thus the external event
  loop never knows it should watch for errors. Worse, libevent, probably
  the most popular event loop library, never sets error indicators, and
  only ever sets the equivalent of POLLIN and POLLOUT. The reason, as
  far as I can tell, is that some polling mechanisms don't return error
  indications{

  The attached patch fixes this by checking getsockopt to see if the
  connect succeeded or failed. I haven't tested this in libdrizzle
  itself (I maintain my own copy in my project), but this works for me.
  Thanks!

To manage notifications about this bug go to:
https://bugs.launchpad.net/drizzle/+bug/879027/+subscriptions


Follow ups

References