Don't lock the main_mutex, just lock the offline_mutex and wait one second.
(aiming to prevent that sporadic deadlock issue...)