* commit 'af685f3bb566f297deee1615d55d4f33d5580ba3': Refactor how timeouts are calculated. (DO NOT MERGE)