Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(637)

Issue 3215006: AU: Implement exponential back off for 500 and 503 HTTP response codes. (Closed)

Created:
10 years, 3 months ago by petkov
Modified:
9 years, 7 months ago
Reviewers:
adlr
CC:
chromium-os-reviews_chromium.org, adlr
Visibility:
Public.

Description

AU: Implement exponential back off for 500 and 503 HTTP response codes. Also refactors the automatic update checks into a separate scheduler class and adds unit tests for them. update_check_scheduler.cc 59 / 59: 100.0% update_check_scheduler.h 1 / 1: 100.0% Note: because the unit tests for this CL use the UpdateAttempter class, the CL brings in several untested modules into the test report reducing the overall test coverage to ~82%. BUG=2394 TEST=unit tests, gmerged on device and inspected logs Change-Id: I078b1727b5338f6fc34e51f5e04a375518d63cef

Patch Set 1 #

Patch Set 2 : comments #

Patch Set 3 : g_timeout_add_seconds tests, fixes #

Patch Set 4 : improve test coverage #

Patch Set 5 : comments #

Total comments: 13

Patch Set 6 : check for negative interval after fuzzing #

Patch Set 7 : elaborate on the CHECK #

Unified diffs Side-by-side diffs Delta from patch set Stats (+571 lines, -61 lines) Patch
M SConstruct View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M download_action.h View 1 chunk +2 lines, -0 lines 0 comments Download
M main.cc View 2 chunks +9 lines, -7 lines 0 comments Download
M omaha_request_action.h View 1 chunk +2 lines, -0 lines 0 comments Download
M update_attempter.h View 1 2 3 5 chunks +21 lines, -12 lines 0 comments Download
M update_attempter.cc View 10 chunks +27 lines, -42 lines 0 comments Download
A update_attempter_mock.h View 1 chunk +24 lines, -0 lines 0 comments Download
A update_check_scheduler.h View 1 2 3 4 5 1 chunk +118 lines, -0 lines 0 comments Download
A update_check_scheduler.cc View 1 2 3 4 5 6 1 chunk +128 lines, -0 lines 0 comments Download
A update_check_scheduler_unittest.cc View 1 2 3 4 5 1 chunk +238 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
petkov
10 years, 3 months ago (2010-08-30 05:20:29 UTC) #1
adlr
Re coverage: i guess it's okay that it goes down a lot, since it's more ...
10 years, 3 months ago (2010-08-30 19:14:45 UTC) #2
petkov
PTAL http://codereview.chromium.org/3215006/diff/8001/9008 File update_check_scheduler.cc (right): http://codereview.chromium.org/3215006/diff/8001/9008#newcode14 update_check_scheduler.cc:14: const int UpdateCheckScheduler::kTimeoutMaxBackoff = 4 * 60 * ...
10 years, 3 months ago (2010-08-30 19:45:11 UTC) #3
petkov
http://codereview.chromium.org/3215006/diff/8001/9008 File update_check_scheduler.cc (right): http://codereview.chromium.org/3215006/diff/8001/9008#newcode78 update_check_scheduler.cc:78: CHECK(me->update_attempter_->status() != UPDATE_STATUS_IDLE || On 2010/08/30 19:45:11, petkov wrote: ...
10 years, 3 months ago (2010-08-30 20:02:27 UTC) #4
adlr
LGTM Thanks for the explanations. -andrew On Mon, Aug 30, 2010 at 1:02 PM, <petkov@chromium.org> ...
10 years, 3 months ago (2010-08-30 20:17:20 UTC) #5
petkov
10 years, 3 months ago (2010-08-30 20:29:37 UTC) #6
On 2010/08/30 20:17:20, adlr wrote:
> LGTM
> 
> Thanks for the explanations.

Pushing... I've added the CHECK motivation as a comment in the code.

> 
> -andrew
> 
> On Mon, Aug 30, 2010 at 1:02 PM, <mailto:petkov@chromium.org> wrote:
> 
> >
> > http://codereview.chromium.org/3215006/diff/8001/9008
> > File update_check_scheduler.cc (right):
> >
> > http://codereview.chromium.org/3215006/diff/8001/9008#newcode78
> > update_check_scheduler.cc:78: CHECK(me->update_attempter_->status() !=
> > UPDATE_STATUS_IDLE ||
> > On 2010/08/30 19:45:11, petkov wrote:
> >
> >> On 2010/08/30 19:14:45, adlr wrote:
> >> > log a warning rather than crash?
> >>
> >
> >  Actually, I think it's better if it's a crash. If we leave it as a
> >>
> > warning, then
> >
> >> no more automatic update checks will be scheduled. A crash would cause
> >>
> > the
> >
> >> update_engine daemon to restarted (while it's in an idle state).
> >>
> >
> >
> > I should elaborate here a bit. This check should never fail. If it
> > fails, it means there's a serious bug somewhere, and we'll stop
> > scheduling further automatic update checks in this update_engine
> > session. It seems better to crash in such case and restart update_engine
> > into, supposedly, a known good state.
> >
> > http://codereview.chromium.org/3215006/show
> >
>

Powered by Google App Engine
This is Rietveld 408576698