Merge lp://staging/~nikwen/account-polld/authenticate-again-fix into lp://staging/~ubuntu-push-hackers/account-polld/trunk
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | John Lenton | ||||||||
Approved revision: | 103 | ||||||||
Merged at revision: | 114 | ||||||||
Proposed branch: | lp://staging/~nikwen/account-polld/authenticate-again-fix | ||||||||
Merge into: | lp://staging/~ubuntu-push-hackers/account-polld/trunk | ||||||||
Diff against target: |
55 lines (+21/-6) 2 files modified
cmd/account-polld/account_manager.go (+1/-0) cmd/account-polld/main.go (+20/-6) |
||||||||
To merge this branch: | bzr merge lp://staging/~nikwen/account-polld/authenticate-again-fix | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
John Lenton (community) | Approve | ||
Niklas Wenzel (community) | Approve | ||
Review via email: mp+238900@code.staging.launchpad.net |
Description of the change
When an account fails to authenticate once (e.g. when there is no network connection after booting), it needs to try to login again afterwards.
Currently the old error permanently prevents it from trying again as a.authData.Error != nil, which makes the poll() function exit immediately. Therefore, that flag needs to be reset to make the account authenticate again afterwards.
This MP also prevents the info->watcher-
Excerpt from the logs:
2014/10/19 17:23:15 Received Poll()
2014/10/19 17:23:15 Leaving poll for account 3 as penaly count is 1
2014/10/19 17:23:15 Starting poll for account 4
2014/10/19 17:23:15 Polling account 4
2014/10/19 17:23:15 Account 4 failed to authenticate: GDBus.Error:
2014/10/19 17:23:45 Poll for account 4 has timed out out after 30s
2014/10/19 17:23:45 Ending poll for account 4
2014/10/19 17:28:50 Received Poll()
2014/10/19 17:28:50 Starting poll for account 3
2014/10/19 17:28:50 Leaving poll for account 4 as penaly count is 1
2014/10/19 17:28:50 Polling account 3
2014/10/19 17:28:50 Account 3 failed to authenticate: GDBus.Error:
2014/10/19 17:29:20 Poll for account 3 has timed out out after 30s
2014/10/19 17:29:20 Ending poll for account 3
2014/10/19 17:34:25 Received Poll()
2014/10/19 17:34:25 Leaving poll for account 3 as penaly count is 1
2014/10/19 17:34:25 Starting poll for account 4
2014/10/19 17:34:25 Polling account 4
2014/10/19 17:34:25 Account 4 failed to authenticate: GDBus.Error:
2014/10/19 17:34:55 Poll for account 4 has timed out out after 30s
2014/10/19 17:34:55 Ending poll for account 4
2014/10/19 17:40:00 Received Poll()
2014/10/19 17:40:00 Starting poll for account 3
2014/10/19 17:40:00 Leaving poll for account 4 as penaly count is 1
2014/10/19 17:40:00 Polling account 3
2014/10/19 17:40:00 Account 3 failed to authenticate: GDBus.Error:
2014/10/19 17:40:30 Poll for account 3 has timed out out after 30s
2014/10/19 17:40:30 Ending poll for account 3
I'm not understanding how this fixes the issue you purport it to. Care to explain?
What it does is carry on a single poll even if auth fails. If this works for you, we're doing something wrong.