@mrshenli - Yes that is the code block that should abort the op if it times out.
@Yi_Zhang - There is a workaround. The all_reduce call actually returns an async work handle. You can capture that handle and wait on it as such:
work = dist.all_reduce(..., async_op=True)
work.wait(SOME_TIMEOUT)

If the all_reduce call times out, then the wait call will throw an exception.
In the meantime, let me try to repro from your most recent code snippet.