Skip to content

Commit 3274dc1

Browse files
author
alex.liang
committed
fixed #90: when stopping the run, window crashed.
1 parent 1980e0a commit 3274dc1

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

python/fedml/cli/edge_deployment/client_login.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,14 +299,16 @@ def run(self):
299299

300300
def reset_devices_status(self, edge_id):
301301
self.mlops_metrics.report_client_training_status(edge_id, MqttManager.MSG_MLOPS_CLIENT_STATUS_FINISHED)
302-
time.sleep(3)
303302

304303
def stop_run(self):
305304
self.setup_client_mqtt_mgr()
306305

307306
self.reset_devices_status(self.edge_id)
308307

309-
FedMLClientRunner.cleanup_learning_process()
308+
try:
309+
FedMLClientRunner.cleanup_learning_process()
310+
except Exception as e:
311+
pass
310312
click.echo("Stop run successfully.")
311313

312314
def setup_client_mqtt_mgr(self):
@@ -374,7 +376,10 @@ def callback_stop_train(self, topic, payload):
374376

375377
# Stop cross-silo server with multi processing mode
376378
self.request_json = request_json
377-
multiprocessing.Process(target=self.stop_run).start()
379+
try:
380+
multiprocessing.Process(target=self.stop_run).start()
381+
except Exception as e:
382+
pass
378383

379384
def cleanup_client_with_finished_status(self):
380385
self.setup_client_mqtt_mgr()

0 commit comments

Comments
 (0)