`return_code` is not guaranteed to be set when this gets called. I tried to terminate a remote job and ended up hanging my instance.