[Sqlrelay-discussion] Fwd: possible bug
Brought to you by:
mused
|
From: Georgy K. <ge...@st...> - 2012-04-16 11:12:10
|
Hello!
Sorry for my bad english
I use query from sqlrelay as client.
When sqlr-listener has a error by getting connection (getAConnection in
handOffClient function), so it send error code to client, but not call
flushWriteBuffer. In this case query don't recieve a error message from listener
and wait, and listener wait disconnect message from client
(waitForClientClose).
Small example: all connections to db will wait at db locks. A new forked
listener wait for a free connection (at waitForConnection) and has timeout
(waitForConnection return false). In this case sqlr-listener and query will
hang.
When use this code (at bool sqlrlistener::handOffClient(filedescriptor *sock)):
if (!getAConnection(&connectionpid,&inetport,
unixportstr,&unixportstrlen)) {
// fatal error occurred while getting a connection
sock->write((uint16_t)ERROR);
sock->write((uint16_t)70);
sock->write("The listener failed to hand the client off to the
database connection.");
flushWriteBuffer(sock);
retval=false;
break;
}
all works fine.
My system: Debian Linux (3.0.2), amd64, rudiments 0.34 and sqlrelay 0.43,
Oracle as database
|