Skip to content

Commit

Permalink
uncaught exception in Commander next
Browse files Browse the repository at this point in the history
  • Loading branch information
julien6387 committed Aug 14, 2023
1 parent fa66352 commit 1e252ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

* Fix `flask-restx` dependency in setup according to Python version.

* Fix uncaught exception the request to start a process is rejected due to a lack of resources.
The exception was dependent from the Python version (absent in 3.6 but raised in 3.9).

* Monkeypatch fix of [Supervisor Issue #1596](https://github.com/Supervisor/supervisor/issues/1596).
Shutdown of the asyncore socket before it is closed.

Expand Down
2 changes: 1 addition & 1 deletion supvisors/commander.py
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ def next(self) -> None:
self.logger.debug(f'{self.class_name}.next: sequence={sequence_number}'
f' current_jobs={self.current_jobs}')
# iterate on copy to avoid problems with key deletions
for application_name, application_job in self.current_jobs.items():
for application_name, application_job in self.current_jobs.copy().items():
self.logger.info(f'{self.class_name}.next: start processing {application_name}')
application_job.before()
application_job.next()
Expand Down
4 changes: 2 additions & 2 deletions supvisors/tests/test_commander.py
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ def test_commander_next(mocker, commander, application_job_1, application_job_2)
assert not mocked_job2_next.called
assert not mocked_job2_progress.called
assert not mocked_after.called
assert commander.supvisors.context.local_instance.state_modes.starting_jobs
assert commander.supvisors.context.local_status.state_modes.starting_jobs
mocker.resetall()
# set application_job_1 not in progress anymore
# will be removed from current_jobs and application_job_2
Expand All @@ -1159,7 +1159,7 @@ def test_commander_next(mocker, commander, application_job_1, application_job_2)
assert mocked_job2_next.called
assert mocked_job2_progress.called
assert mocked_after.call_args_list == [call(application_job_1), call(application_job_2)]
assert not commander.supvisors.context.local_instance.state_modes.starting_jobs
assert not commander.supvisors.context.local_status.state_modes.starting_jobs


def test_commander_check(mocker, commander, application_job_1, application_job_2):
Expand Down

0 comments on commit 1e252ca

Please sign in to comment.