Merge lp:~rvb/maas/bug-1442059 into lp:~maas-committers/maas/trunk

Proposed by Raphaël Badin
Status: Merged
Approved by: Raphaël Badin
Approved revision: no longer in the source branch.
Merged at revision: 3834
Proposed branch: lp:~rvb/maas/bug-1442059
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 15 lines (+2/-2)
1 file modified
src/provisioningserver/rpc/power.py (+2/-2)
To merge this branch: bzr merge lp:~rvb/maas/bug-1442059
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+257039@code.launchpad.net

Commit message

Set the timeout used by twisted to cancel the power action to 5 minutes. There is already a timeout that depends on the retry policy (how power actions are retried at the Python level) and what the power template does. In the case of AMT, where the template itself does some retrying, the original timeout of 2 minutes wasn't enough (yes, AMT is that flaky).

Description of the change

Another fix would have been to watch the PXE requests and immediately mark the power action as successful when the node MAAS is trying to power up PXE boots. I decided against it because this is both racy and involved (it would tie together two fairly independent systems in MAAS: the power mechanism and the PXE request endpoint).

When we port the power templates to Python, we can rationalize how we deal with timeouts: right now each layer has its own timeout.

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/provisioningserver/rpc/power.py'
2--- src/provisioningserver/rpc/power.py 2015-04-01 11:44:04 +0000
3+++ src/provisioningserver/rpc/power.py 2015-04-22 09:29:14 +0000
4@@ -77,9 +77,9 @@
5 ]
6
7
8-# Timeout for change_power_state(). We set it to 2 minutes by default,
9+# Timeout for change_power_state(). We set it to 5 minutes by default,
10 # but it would be lovely if this was configurable.
11-CHANGE_POWER_STATE_TIMEOUT = timedelta(minutes=2).total_seconds()
12+CHANGE_POWER_STATE_TIMEOUT = timedelta(minutes=5).total_seconds()
13
14
15 maaslog = get_maas_logger("power")