[JIT] Set future's error to current exception as is when `--torch_jit_enable_rethrow_...
authorDon Jang <djang@fb.com>
Tue, 17 Aug 2021 00:30:26 +0000 (17:30 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 17 Aug 2021 00:32:13 +0000 (17:32 -0700)
commite7724bb100a37b006fba66b861165ba07082ecbf
tree8fadd125f6c19255099c75af0fd9ab688569fbe0
parent075024b9a34904ec3ecdab3704c3bcaa329bdfea
[JIT] Set future's error to current exception as is when `--torch_jit_enable_rethrow_caught_exception=true` (#63348)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63348

This change addresses singlaiiit's comment on D30241792 (https://github.com/pytorch/pytorch/commit/61b49c8e41a2faf7fd40278ca72616c5d92963cb), which makes the JIT interpreter's behavior consistent between `future` is set and not.

Test Plan: Enhanced `EnableRethrowCaughtExceptionTest.EnableRethrowCaughtExceptionTestRethrowsCaughtException` to cover the modified code path.

Reviewed By: singlaiiit

Differential Revision: D30347782

fbshipit-source-id: 79ce57283154ca4372e5341217d942398db21ac8
test/cpp/jit/test_interpreter.cpp
torch/csrc/jit/runtime/interpreter.cpp