Merge lp:~sergiusens/nuntium/generic_failure_lee into lp:nuntium

Proposed by Sergio Schvezov
Status: Merged
Approved by: Ricardo Mendoza
Approved revision: 80
Merged at revision: 80
Proposed branch: lp:~sergiusens/nuntium/generic_failure_lee
Merge into: lp:nuntium
Diff against target: 29 lines (+3/-2)
1 file modified
ofono/modem.go (+3/-2)
To merge this branch: bzr merge lp:~sergiusens/nuntium/generic_failure_lee
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Alfonso Sanchez-Beato Approve
Review via email: mp+238191@code.launchpad.net

Commit message

Hold off on retrying when ofono fails to activate a context with a generic failure

Description of the change

With this fix
2014/10/13 13:28:01 Cannot set Activate to true (try 1/3) interface on /ril_0/context2: org.ofono.Error.Failed: Operation failed
2014/10/13 13:28:08 Starting download of http://172.25.8.131/?message-id=m04VTeUBc00 with proxy 172.25.7.31:8080

Instead of three consecutive failed retries

To post a comment you must log in.
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ofono/modem.go'
2--- ofono/modem.go 2014-10-02 01:24:13 +0000
3+++ ofono/modem.go 2014-10-13 16:33:00 +0000
4@@ -41,6 +41,7 @@
5
6 const (
7 ofonoAttachInProgressError = "org.ofono.AttachInProgress"
8+ ofonoFailed = "org.ofono.Error.Failed"
9 ofonoInProgressError = "org.ofono.InProgress"
10 ofonoNotAttachedError = "org.ofono.Error.NotAttached"
11 )
12@@ -270,7 +271,7 @@
13
14 func activationErrorNeedsWait(err error) bool {
15 if dbusErr, ok := err.(*dbus.Error); ok {
16- return dbusErr.Name == ofonoInProgressError || dbusErr.Name == ofonoAttachInProgressError || dbusErr.Name == ofonoNotAttachedError
17+ return dbusErr.Name == ofonoInProgressError || dbusErr.Name == ofonoAttachInProgressError || dbusErr.Name == ofonoNotAttachedError || dbusErr.Name == ofonoFailed
18 }
19 return false
20 }
21@@ -283,7 +284,7 @@
22 if err != nil {
23 log.Printf("Cannot set Activate to %t (try %d/3) interface on %s: %s", state, i+1, context.ObjectPath, err)
24 if activationErrorNeedsWait(err) {
25- time.Sleep(2 * time.Second)
26+ time.Sleep(5 * time.Second)
27 }
28 } else {
29 return nil

Subscribers

People subscribed via source and target branches