The problem I am trying to solve is to wrap all flush functions in order to catch DeadLockExceptions and try at least 3 times again. The idea is to make the default
flush