Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Mysql auto-reconnect doesn't kick in on network interface crash.

by Ossory (Initiate)
on Feb 04, 2009 at 12:15 UTC ( [id://741244]=note: print w/replies, xml ) Need Help??


in reply to Re: Mysql auto-reconnect doesn't kick in on network interface crash.
in thread Mysql auto-reconnect doesn't kick in on network interface crash.

Thanks for the advices, I will look into auto_reconnects_failed/auto_reconnects_ok

Do it anyway :)
Well, this is not possible and here's why: the application in question is reading from a fifo. Another app writes into that fifo in nonblocking mode at a very high rate. Attempting to restore the connection from scratch takes quite some time and there is a good chance, that the fifo will overflow, so some data will be dropped from it. Sometimes, it happens that MySQL server, indeed, "goes away" - gets taken down for backup etc etc. So I cannot really attempt to restore the connection every single time the query fails because "The server has gone away". My aim is to isolate the problem, that I described in my original post so I can deal with it in its own way, and leave everything else intact.

  • Comment on Re^2: Mysql auto-reconnect doesn't kick in on network interface crash.

Replies are listed 'Best First'.
Re^3: Mysql auto-reconnect doesn't kick in on network interface crash.
by matija (Priest) on Feb 04, 2009 at 14:17 UTC

    I think you're approaching the problem the wrong way. Either you're not bothered by the events that gets lost when the server legitimately "goes away", or you are.

    If the record are that precious, you should have some kind of a caching mechanism on your side that will read from the fifo and store the records until you can send them to the Mysql server. It could be a simple thread that stores stuff into one end of the array, while your thread takes them out from the other end.

    Otherwise, don't sweat the time you lose trying to reconnect to a server that has legitimately gone away - if you can't store the stuff you're not sending to the server, the events sent while the server is down are lost, anyway.

      Thanks for the help, everyone.

      And, matija, I think, that you are right, its time to rewrite that app using threads, since that would nullify my problem completely.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://741244]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-19 20:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found