Merge ~igor-brovtsin/maas:lp-1743648 into maas:master

Proposed by Igor Brovtsin
Status: Merged
Approved by: Igor Brovtsin
Approved revision: faf9a24ec8eb7303092a7989bec583d98f025835
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~igor-brovtsin/maas:lp-1743648
Merge into: maas:master
Diff against target: 218 lines (+109/-31)
4 files modified
src/maasserver/bootresources.py (+25/-26)
src/maasserver/listener.py (+12/-0)
src/maasserver/tests/test_bootresources.py (+47/-5)
src/maasserver/tests/test_listener.py (+25/-0)
Reviewer Review Type Date Requested Status
MAAS Lander Approve
Alberto Donato Approve
Review via email: mp+439621@code.staging.launchpad.net

Commit message

Improved listener (un)registration for images sync

Fixes LP#1743648

Description of the change

This MP fixes the issue described in LP#1743648 that prevents image sync after failed attempt to call `download_boot_resources`. Any exception risen by `download_boot_resources` will prevent `unregister` call from ever happening, so further attempts to call `download_all_boot_resources` will fail due to channel handler being already registered.

To address the issue, I introduced `@contextmanager`-decorated function `PostgresListenerService.listen` that registers and unregisters handlers for developer convenience.

To post a comment you must log in.
Revision history for this message
Alberto Donato (ack) :
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b lp-1743648 lp:~igor-brovtsin/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: FAILED
LOG: http://maas-ci.internal:8080/job/maas-tester/2214/consoleText
COMMIT: 7caf092778bfcb21a0a181b668d017527d2ac558

review: Needs Fixing
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b lp-1743648 lp:~igor-brovtsin/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 5c1bf9bd71b1fb87ad04778c9287aae5b1259ba8

review: Approve
Revision history for this message
Alberto Donato (ack) :
Revision history for this message
Alberto Donato (ack) wrote :

+1 with a nit inline

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b lp-1743648 lp:~igor-brovtsin/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: faf9a24ec8eb7303092a7989bec583d98f025835

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches