This makes the code much easier to read, and much less error prone.
Because some operations use the _timeout_commit() it happens that a timeout is active while we shutdown. This makes sure everything is commited before shutdown.