Moving timeout logic from engines into worker