Skip to content

Commit 556be6d

Browse files
authored
fix popen error (#24767) (#25215)
replace join to terminate, test=develop
1 parent 5e6848d commit 556be6d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

python/paddle/distributed/utils.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,15 +252,12 @@ def get_cluster(node_ips, node_ip, paddle_ports, selected_gpus):
252252
def terminate_local_procs(procs):
253253
for p in procs:
254254
if p.proc.poll() is None:
255-
# subprocess need to release resource(e.g. shared memory)
256-
# use join to wait subprocess releasing
257-
p.proc.join(timeout=1)
255+
p.proc.terminate()
258256
p.log_fn.close()
259257
logger.debug("terminate process id:{}".format(p.proc.pid))
260258

261-
# wait all process terminiated
262-
# time.sleep(3)
263-
259+
#wait all process terminiated
260+
time.sleep(3)
264261
for step in range(0, 50):
265262
alive = False
266263
for p in procs:

0 commit comments

Comments
 (0)