Skip to content

Commit 4d26448

Browse files
Properly terminate MultiProcessing Runtime (#16623)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent cd02f3a commit 4d26448

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/lightning/app/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
4444

4545
### Fixed
4646

47+
- Fixed a deadlock causing apps not to exit properly when running locally ([#16623](https://github.com/Lightning-AI/lightning/pull/16623)))
48+
49+
4750
- Fixed the Drive root_folder not parsed properly ([#16454](https://github.com/Lightning-AI/lightning/pull/16454))
4851

4952
- Fixed malformed path when downloading files using `lightning cp` ([#16626](https://github.com/Lightning-AI/lightning/pull/16626))

src/lightning/app/utilities/proxies.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -613,15 +613,16 @@ def _sigterm_signal_handler(self, signum, frame, call_hash: str) -> None:
613613
self.work._calls[call_hash]["statuses"].append(
614614
make_status(WorkStageStatus.STOPPED, reason=WorkStopReasons.SIGTERM_SIGNAL_HANDLER)
615615
)
616-
delta = Delta(DeepDiff(state, self.work.state, verbose_level=2))
617-
self.delta_queue.put(ComponentDelta(id=self.work_name, delta=delta))
618616

619617
# kill the thread as the job is going to be terminated.
620-
self.copier.join(0)
621618
if self.state_observer:
622619
if self.state_observer.started:
623620
self.state_observer.join(0)
624621
self.state_observer = None
622+
delta = Delta(DeepDiff(state, deepcopy(self.work.state), verbose_level=2))
623+
self.delta_queue.put(ComponentDelta(id=self.work_name, delta=delta))
624+
625+
self.copier.join(0)
625626
raise LightningSigtermStateException(0)
626627

627628
def _proxy_setattr(self, cleanup: bool = False):

0 commit comments

Comments
 (0)