Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(104)

Issue 74900044: worker/instancepoller: batch instancepoller

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 1 month ago by fuzzyman
Modified:
10 years, 1 month ago
Reviewers:
mp+209966, rog, natefinch, mfoord
Visibility:
Public.

Description

worker/instancepoller: batch instancepoller use ratelimit Token Bucket to batch requests in the instance poller. Mitigates launchpad issue 1277397 https://code.launchpad.net/~mfoord/juju-core/instancepoller-aggregate/+merge/209966 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 25

Patch Set 2 : worker/instancepoller: batch instancepoller #

Total comments: 4

Patch Set 3 : worker/instancepoller: batch instancepoller #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+332 lines, -19 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M container/lxc/lxc.go View 1 1 chunk +1 line, -1 line 0 comments Download
M dependencies.tsv View 1 1 chunk +2 lines, -1 line 0 comments Download
M instance/address.go View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M instance/address_test.go View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A worker/instancepoller/aggregate.go View 1 2 1 chunk +120 lines, -0 lines 0 comments Download
A worker/instancepoller/aggregate_test.go View 1 2 1 chunk +187 lines, -0 lines 1 comment Download
M worker/instancepoller/worker.go View 4 chunks +2 lines, -17 lines 0 comments Download
M worker/instancepoller/worker_test.go View 1 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 9
fuzzyman
Please take a look.
10 years, 1 month ago (2014-03-12 18:17:11 UTC) #1
natefinch
Generally LGTM... just a few minor things. https://codereview.appspot.com/74900044/diff/1/worker/instancepoller/aggregate.go File worker/instancepoller/aggregate.go (right): https://codereview.appspot.com/74900044/diff/1/worker/instancepoller/aggregate.go#newcode22 worker/instancepoller/aggregate.go:22: type aggregator ...
10 years, 1 month ago (2014-03-12 19:48:50 UTC) #2
rog
The code and the test coverage looks generally great, thanks. Quite a few comments here ...
10 years, 1 month ago (2014-03-12 20:50:06 UTC) #3
mfoord
There's new code (tests especially) that needs reviewing. I may have one or two more ...
10 years, 1 month ago (2014-03-13 14:37:40 UTC) #4
mfoord
On 2014/03/13 14:37:40, mfoord wrote: > There's new code (tests especially) that needs reviewing. I ...
10 years, 1 month ago (2014-03-13 14:41:23 UTC) #5
fuzzyman
Please take a look.
10 years, 1 month ago (2014-03-13 16:13:10 UTC) #6
rog
LGTM with the timing-based test fixed to make it less potentially flaky. https://codereview.appspot.com/74900044/diff/20001/worker/instancepoller/aggregate.go File worker/instancepoller/aggregate.go ...
10 years, 1 month ago (2014-03-13 16:32:59 UTC) #7
fuzzyman
Please take a look.
10 years, 1 month ago (2014-03-13 17:58:38 UTC) #8
rog
10 years, 1 month ago (2014-03-13 18:26:57 UTC) #9
LGTM with the fix below.

https://codereview.appspot.com/74900044/diff/40001/worker/instancepoller/aggr...
File worker/instancepoller/aggregate_test.go (right):

https://codereview.appspot.com/74900044/diff/40001/worker/instancepoller/aggr...
worker/instancepoller/aggregate_test.go:57: i.counter =
atomic.AddInt32(&i.counter, 1)
ha ha, this is wrong, although it will work in the single-threaded case. The
reason AddInt32 takes a pointer is because it does the atomic increment itself.
By assigning to i.counter outside of that, we raise the possibility that we
might undo an add made by another concurrent call to AddInt32.

just lose the "i.counter = " bit.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b