Client should exp backoff reconnect even when connect was successful
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu Push Notifications |
Fix Released
|
High
|
John Lenton | ||
ubuntu-push (Ubuntu) |
Fix Released
|
High
|
John Lenton | ||
Trusty |
Fix Released
|
High
|
John Lenton |
Bug Description
Client should exp backoff reconnect even when connect was successful. This would protect us from some situations (already arisen: a server bug that disconnects us hard, after accepting the connection).
[Impact]
ubuntu-push-client reattempts connection in a loop, driving load up, as well as disk usage (through the logs) and draining the battery.
[Test Case]
This test case demonstrates the problem by reproducing lp:1309237. You need:
* a computer capable of running the ubuntu push server.
* at least two devices using the stable image and that can talk to the computer over the network
on a computer reachable from the devices, do:
mkdir -p test-case-
cd !$
bzr branch lp:ubuntu-push
cd ubuntu-push
make bootstrap
sed -i~ -e 's/127.0.0.1//g' sampleconfigs/
make run-server-dev
on the devices, edit /etc/xdg/
"addr": "192.168.1.1:9090"
(note there is no https:// as the hosts discovery step is being skipped).
Reboot the devices. Tailing ~phablet/
[Regression potential]
If a device hits the connects-
Related branches
- Samuele Pedroni: Approve
-
Diff: 268 lines (+140/-0)2 files modifiedclient/session/session.go (+40/-0)
client/session/session_test.go (+100/-0)
Changed in ubuntu-push: | |
status: | Confirmed → Fix Committed |
affects: | ubuntu → ubuntu-push (Ubuntu) |
Changed in ubuntu-push (Ubuntu): | |
status: | New → In Progress |
assignee: | nobody → John Lenton (chipaca) |
importance: | Undecided → High |
description: | updated |
tags: |
added: verification-done removed: verification-needed |
Changed in ubuntu-push: | |
status: | Fix Committed → Fix Released |
this is trickier than simple backoff with reset on connect, since it should go to some minutes when trying to much, but if we disconnect every, say, 30 minutes, it should still retry at once.
Also, we need to make sure that we dont have any unexpected holes like this somewhere else on the code.