Closed Bug 1041613 Opened 5 years ago Closed 5 years ago

Timeout requests to the server

Categories

(Firefox OS Graveyard :: FindMyDevice, defect)

defect
Not set

Tracking

(blocking-b2g:2.0+, b2g-v2.0 fixed, b2g-v2.1 fixed)

RESOLVED FIXED
2.1 S1 (1aug)
blocking-b2g 2.0+
Tracking Status
b2g-v2.0 --- fixed
b2g-v2.1 --- fixed

People

(Reporter: ggp, Assigned: ggp)

References

Details

Attachments

(1 file)

46 bytes, text/x-github-pull-request
gerard-majax
: review+
Details | Review
We should add a timeout parameter to all requests we make to the server, since now we're holding a wakelock until the server replies.
One minute sounds like a reasonable time.
Attached file gaia pull request
This is also a good opportunity to add unit tests to the Requester, at which point we can dupe bug 984855 with this one.
Attachment #8460262 - Flags: review?(lissyx+mozillians)
[Blocking Requested - why for this release]:Because it blocks another blocker, bug 1040588.
blocking-b2g: --- → 2.0?
PR updated to use sinon.assert.called and fix a test failure.
FYI, for testing one need to null route find.firefox.com:

I did it successfully by hacking the hosts on my Flame:
> # echo "10.255.255.1 find.firefox.com" >> /etc/hosts

After making sure that 10.255.255.1 will not trigger a reject or anything, but rather a timeout. Then process to registering and enabling FMD, I see the system timing out as expected, after 60 secs:

> 07-23 17:07:35.098  1226  1226 I GeckoDump: [findmydevice] enabled state changed, trying to reach the server
> 07-23 17:07:35.098  1226  1226 I GeckoDump: [findmydevice] begin high priority section, reason: "clientLogic"
> 07-23 17:07:35.108  1226  1226 I GeckoDump: [findmydevice] acquiring one wakelock, wakelocks are: {"clientLogic":[],"command":[]}
> 07-23 17:07:35.108  1226  1226 I GeckoDump: [findmydevice] findmydevice attempting registration.
> 07-23 17:07:35.108  1226  1226 I GeckoDump: [findmydevice] registering: false
> 07-23 17:07:35.148  1226  1226 I GeckoDump: [findmydevice] logged in to FxA
> 07-23 17:07:36.738  1226  1226 I GeckoDump: [findmydevice] findmydevice received push endpoint!
> 07-23 17:07:36.738  1226  1226 I GeckoDump: [findmydevice] POST-ing to https://find.firefox.com/1/register/: [...]
> 07-23 17:08:36.748  1226  1226 I GeckoDump: [findmydevice] server request timed out!
> 07-23 17:08:36.748  1226  1226 I GeckoDump: [findmydevice] request failed with status 0
> 07-23 17:08:36.748  1226  1226 I GeckoDump: [findmydevice] findmydevice request failed with status: 0
> 07-23 17:08:36.808  1226  1226 I GeckoDump: [findmydevice] end high priority section, reason: "clientLogic"
> 07-23 17:08:36.808  1226  1226 I GeckoDump: [findmydevice] releasing one wakelock, wakelocks are: {"clientLogic":[{}],"command":[]}

So it seems to be working as expected :)
Comment on attachment 8460262 [details] [review]
gaia pull request

Thanks for this, please wait green try to land :)
Attachment #8460262 - Flags: review?(lissyx+mozillians) → review+
Keywords: checkin-needed
Duplicate of this bug: 984855
there seems to be merge conflicts since travis reports https://travis-ci.org/mozilla-b2g/gaia/builds/30659743
Keywords: checkin-needed
Sorry, there was indeed a conflict. I rebased, and Gaia-Try is green: https://tbpl.mozilla.org/?rev=12660ce5c1679220f39070d63fda9b46ae10a76e&tree=Gaia-Try
Keywords: checkin-needed
no problem, merged now :)

master: https://github.com/mozilla-b2g/gaia/commit/895268b9322a2e2567c5c96a05396c8723816f58
Status: NEW → RESOLVED
Closed: 5 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 2.1 S1 (1aug)
blocking-b2g: 2.0? → 2.0+
You need to log in before you can comment on or make changes to this bug.