Messages in this thread | | | From | "David Schwartz" <> | Subject | RE: poll() blocked / packets not received ? | Date | Mon, 20 Oct 2008 16:21:11 -0700 |
| |
> I agree with both points, but I can't modify the MySQL protocol to > implement that.
> For (1) I can't add the timeout since I have no way to differentiate > between a lost connection and a request that takes time to execute. I'll > maybe check if the protocol allow pings while waiting for the request > result, but I'm not sure it does.
Sure you can. For example, you can run a proxy on both the server and the client, with the two proxies speaking a protocol that carries the MySQL protocol. The protocol between the server and the client can include two types of messages, one being regular data (which the proxies pass to the server and client software) and one being a ping (which the proxies use internally to decide when to drop their connections). Each proxy can 'ping' the other as often as required and drop both connections if the ping fails to go through. This will ensure that your program detects a connection loss rapidly.
There are many other possible solutions.
> For (2) the shared resources is on the database side, not on the server > side. It's the transaction that have some rows locked. I have no > solution for that.
That doesn't fit your problem description. Presumably the server detected the loss of the connection and so would have released any resources it was holding that were associated with it. The problem in this case was that the client couldn't detect the loss of the connection.
> Best, > Nicolas
Good luck.
DS
| |