[rllib] set daemon status for PolicyServerInput thread (#7862)

This commit is contained in:
Eric Liang
2020-04-04 16:08:51 -07:00
committed by GitHub
parent 11c2b500b8
commit 630b3b1752
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -90,6 +90,7 @@ class PolicyServerInput(ThreadingMixIn, HTTPServer, InputReader):
logger.info("Starting connector server at {}:{}".format(address, port))
logger.info("")
thread = threading.Thread(name="server", target=self.serve_forever)
thread.daemon = True
thread.start()
@override(InputReader)
+2 -2
View File
@@ -162,8 +162,6 @@ class MultiAgentSampleBatchBuilder:
# Append into policy batches and reset
for agent_id, post_batch in sorted(post_batches.items()):
self.policy_builders[self.agent_to_policy[agent_id]].add_batch(
post_batch)
if self.postp_callback:
self.postp_callback({
"episode": episode,
@@ -172,6 +170,8 @@ class MultiAgentSampleBatchBuilder:
"post_batch": post_batch,
"all_pre_batches": pre_batches,
})
self.policy_builders[self.agent_to_policy[agent_id]].add_batch(
post_batch)
self.agent_builders.clear()
self.agent_to_policy.clear()