{"action":"created","issue":{"url":"https://api.github.com/repos/facebookresearch/habitat-api/issues/260","repository_url":"https://api.github.com/repos/facebookresearch/habitat-api","labels_url":"https://api.github.com/repos/facebookresearch/habitat-api/issues/260/labels{/name}","comments_url":"https://api.github.com/repos/facebookresearch/habitat-api/issues/260/comments","events_url":"https://api.github.com/repos/facebookresearch/habitat-api/issues/260/events","html_url":"https://github.com/facebookresearch/habitat-api/issues/260","id":529667388,"node_id":"MDU6SXNzdWU1Mjk2NjczODg=","number":260,"title":"Is it appropriate to call worker_conn.close() just after ps.start() without ps.join() in _spawn_workers?","user":{"login":"xiaotaw","id":13536925,"node_id":"MDQ6VXNlcjEzNTM2OTI1","avatar_url":"https://avatars0.githubusercontent.com/u/13536925?v=4","gravatar_id":"","url":"https://api.github.com/users/xiaotaw","html_url":"https://github.com/xiaotaw","followers_url":"https://api.github.com/users/xiaotaw/followers","following_url":"https://api.github.com/users/xiaotaw/following{/other_user}","gists_url":"https://api.github.com/users/xiaotaw/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaotaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaotaw/subscriptions","organizations_url":"https://api.github.com/users/xiaotaw/orgs","repos_url":"https://api.github.com/users/xiaotaw/repos","events_url":"https://api.github.com/users/xiaotaw/events{/privacy}","received_events_url":"https://api.github.com/users/xiaotaw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2019-11-28T03:06:47Z","updated_at":"2019-11-29T01:57:31Z","closed_at":null,"author_association":"NONE","body":"## ❓ Questions and Help\r\nSorry, I did not run any test code because had not found any, and just wondering if it is safe to call `worker_conn.close()` just after `ps.start()` without `ps.join()`? \r\n\r\nIt seems that `worker_conn.recv` and `worker_conn.send` are called continuously in the subprocess.\r\n\r\nThank you! \r\n\r\nhttps://github.com/facebookresearch/habitat-api/blob/master/habitat/core/vector_env.py#L251\r\n\r\n```python\r\n    def _spawn_workers(\r\n        self,\r\n        env_fn_args: Sequence[Tuple],\r\n        make_env_fn: Callable[..., Union[Env, RLEnv]] = _make_env_fn,\r\n    ) -> Tuple[List[Callable[[], Any]], List[Callable[[Any], None]]]:\r\n        parent_connections, worker_connections = zip(\r\n            *[self._mp_ctx.Pipe(duplex=True) for _ in range(self._num_envs)]\r\n        )\r\n        self._workers = []\r\n        for worker_conn, parent_conn, env_args in zip(\r\n            worker_connections, parent_connections, env_fn_args\r\n        ):\r\n            ps = self._mp_ctx.Process(\r\n                target=self._worker_env,\r\n                args=(\r\n                    worker_conn.recv,\r\n                    worker_conn.send,\r\n                    make_env_fn,\r\n                    env_args,\r\n                    self._auto_reset_done,\r\n                    worker_conn,\r\n                    parent_conn,\r\n                ),\r\n            )\r\n            self._workers.append(ps)\r\n            ps.daemon = True\r\n            ps.start()\r\n            worker_conn.close()\r\n        return (\r\n            [p.recv for p in parent_connections],\r\n            [p.send for p in parent_connections],\r\n        )\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/facebookresearch/habitat-api/issues/comments/559634530","html_url":"https://github.com/facebookresearch/habitat-api/issues/260#issuecomment-559634530","issue_url":"https://api.github.com/repos/facebookresearch/habitat-api/issues/260","id":559634530,"node_id":"MDEyOklzc3VlQ29tbWVudDU1OTYzNDUzMA==","user":{"login":"erikwijmans","id":12722529,"node_id":"MDQ6VXNlcjEyNzIyNTI5","avatar_url":"https://avatars1.githubusercontent.com/u/12722529?v=4","gravatar_id":"","url":"https://api.github.com/users/erikwijmans","html_url":"https://github.com/erikwijmans","followers_url":"https://api.github.com/users/erikwijmans/followers","following_url":"https://api.github.com/users/erikwijmans/following{/other_user}","gists_url":"https://api.github.com/users/erikwijmans/gists{/gist_id}","starred_url":"https://api.github.com/users/erikwijmans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikwijmans/subscriptions","organizations_url":"https://api.github.com/users/erikwijmans/orgs","repos_url":"https://api.github.com/users/erikwijmans/repos","events_url":"https://api.github.com/users/erikwijmans/events{/privacy}","received_events_url":"https://api.github.com/users/erikwijmans/received_events","type":"User","site_admin":false},"created_at":"2019-11-29T01:57:31Z","updated_at":"2019-11-29T01:57:31Z","author_association":"CONTRIBUTOR","body":"Yeah, that is the flow of things."}}
{"actor":{"display_login":"erikwijmans"}}