Added ping to the master in check_slave_lag() to avoid timeouts.