cr-buildbucket-client.js makes thousands of requests |
||||||
Issue descriptionLooking at the network console when Gerrit is open I'm seeing multiple requests from cr-buildbucket-client per second. This is on pdfium-review.googlesource.com. Devtools lists the callstack as: _fetchWithTags @ cr-buildbucket-client.js:139 getBuilds @ cr-buildbucket-client.js:99 $.client.getOAuthToken.then @ cr-buildbucket-view.js:109 Promise.then (async) _refreshBuilds @ cr-buildbucket-view.js:108 _updateTimerFired @ cr-buildbucket-view.js:164 setTimeout (async) $.client.getBuilds.then.catch.then @ cr-buildbucket-view.js:118 Promise.then (async) $.client.getOAuthToken.then @ cr-buildbucket-view.js:116 Promise.then (async) _refreshBuilds @ cr-buildbucket-view.js:108 _updateTimerFired @ cr-buildbucket-view.js:164 setTimeout (async) $.client.getBuilds.then.catch.then @ cr-buildbucket-view.js:118 Promise.then (async) $.client.getOAuthToken.then @ cr-buildbucket-view.js:116 Promise.then (async) _refreshBuilds @ cr-buildbucket-view.js:108 _updateTimerFired @ cr-buildbucket-view.js:164 setTimeout (async) $.client.getBuilds.then.catch.then @ cr-buildbucket-view.js:118 Promise.then (async) $.client.getOAuthToken.then @ cr-buildbucket-view.js:116 Promise.then (async) _refreshBuilds @ cr-buildbucket-view.js:108 _updateTimerFired @ cr-buildbucket-view.js:164 setTimeout (async) $.client.getBuilds.then.catch.then @ cr-buildbucket-view.js:118 Promise.then (async) $.client.getOAuthToken.then @ cr-buildbucket-view.js:116 Promise.then (async) _refreshBuilds @ cr-buildbucket-view.js:108 _updateTimerFired @ cr-buildbucket-view.js:164 setTimeout (async) $.client.getBuilds.then.catch.then @ cr-buildbucket-view.js:118 Promise.then (async) $.client.getOAuthToken.then @ cr-buildbucket-view.js:116 Promise.then (async) _refreshBuilds @ cr-buildbucket-view.js:108 _updateTimerFired @ cr-buildbucket-view.js:164 setTimeout (async) $.client.getBuilds.then.catch.then @ cr-buildbucket-view.js:118 Promise.then (async) $.client.getOAuthToken.then @ cr-buildbucket-view.js:116 Promise.then (async) _refreshBuilds @ cr-buildbucket-view.js:108 _updateTimerFired @ cr-buildbucket-view.js:164 setTimeout (async) $.client.getBuilds.then.catch.then @ cr-buildbucket-view.js:118 Promise.then (async) $.client.getOAuthToken.then @ cr-buildbucket-view.js:116 Promise.then (async) _refreshBuilds @ cr-buildbucket-view.js:108 _updateTimerFired @ cr-buildbucket-view.js:164
,
Feb 2 2018
,
Feb 2 2018
This is wacky. I can reproduce this by visiting a pdfium review. But not when visiting a chromium review. On chromium, the plugin only updates (and therefore sends network requests) once every 5 seconds, as it is supposed to: https://chromium.googlesource.com/infra/gerrit-plugins/buildbucket/+/master/src/main/resources/static/cr-buildbucket-view.js#7
,
Feb 2 2018
It appears that pdfium is updating once every five seconds... but is doing so twice. Each time it wakes up, it issues *two* options requests, and *two* get requests, per patchset, rather than one of each like it is supposed to. And those two instances sending duplicate requests seem to be able to get out of sync, causing it to look like it is updating every two or three seconds.
,
Feb 2 2018
Even weirder, switching away from the pdfium tab and then back again seems to fix this.
,
Feb 5 2018
,
Feb 5 2018
,
Feb 5 2018
The following revision refers to this bug: https://chromium.googlesource.com/infra/gerrit-plugins/buildbucket/+/d575eaf88b5ce1344e2817cb3e14292a49347925 commit d575eaf88b5ce1344e2817cb3e14292a49347925 Author: Nodir Turakulov <nodir@google.com> Date: Mon Feb 05 23:34:32 2018 [buildbucket] clear update timer Bug 1: Buildbucket plugin makes O(N) requests every 5 sec, where N is the number of CLs visited in the same Chrome tab. This happens because window timeout is never explicitly cleared. Bug 2 : if a CL is open and then user navigates back to the dashboard, the plugin continues to poll buildbucket. Together, they caused excessive QPS on Buildbucket. According to Buildbucket logs, majority of search requests from Gerrit came with referral "https://chromium-review.googlesource.com/dashboard/self". This CL fixes both CLs by clearing update timeout on detach and before creating a new timeout. Also it reverts 9edbc39289f531744a5e418a35967328b7a98c79 Bug: 803356, 809166 Change-Id: I72c00c5b8f7871fb9f65bf0df0a853b6115f39b9 Reviewed-on: https://chromium-review.googlesource.com/902815 Reviewed-by: Aaron Gable <agable@chromium.org> [modify] https://crrev.com/d575eaf88b5ce1344e2817cb3e14292a49347925/src/main/resources/static/cr-buildbucket-view.js
,
Feb 6 2018
,
Feb 6 2018
I wish I was CCed on this bug. It would help investigating the buildbucket quota exhaustion. Aaron, please add buildbucket component on buildbucket plugin bugs in the future (I’m watching them)
,
Feb 6 2018
Sure, will do (fair warning, there can be a lot of them).
,
Feb 12 2018
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by dsinclair@chromium.org
, Feb 2 2018