PDA

View Full Version : Client/server arch: Application freezes if network interface goes down



Pluvius
27th February 2013, 17:46
Hello everyone!

I have a client app that communicates with a remote database, it runs fine except if the ethernet interface goes down (i.e: eth0) or the wire is removed. I'd like to keep my application responsive in this unfortunate situation.

I've already implemented some guards; if the remote mysql server goes down, the application continues to run just fine.

Any help is welcome

EDIT: my idea so far is to add a flag within my application and test for the presence of the network interface through a "system" call, if it's false, it automatically closes the sql connection

Pluvius
28th February 2013, 11:13
Some improvement here:

Using strace, Ive found out that if the network is down, a request to the database will wait until a connection is established and that's what freezes the app