Release GIL during RPC shutdown. (#69586)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69586
In certain scenarios during shutdown the following assert failed:
https://github.com/pytorch/pytorch/blob/master/torch/csrc/distributed/rpc/rpc_agent.cpp#L39.
This was due to _reset_current_rpc_agent not releasing GIL.
Fixed this issue by releasing GIL.
ghstack-source-id: 145062265
Test Plan: waitforbuildbot
Reviewed By: mrshenli
Differential Revision: D32937687
fbshipit-source-id: 980adbcc1e3799b40206f7bca6e7695ca67f0fc2