|
|
Created:
3 years, 11 months ago by vakh (use Gerrit instead) Modified:
3 years, 11 months ago CC:
chromium-reviews, loading-reviews_chromium.org, Randy Smith (Not in Mondays), mmenke, Charlie Harrison Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionHave a list of pending checks instead of pending clients since checks are
unique, but clients aren't.
Also, dump whether the SB check for the URL returned by the DBManager had timed
out.
Also, make the dump buffer smaller hoping to get more minidumps.
BUG=660293
Review-Url: https://codereview.chromium.org/2616653002
Cr-Commit-Position: refs/heads/master@{#442731}
Committed: https://chromium.googlesource.com/chromium/src/+/9f5bdb322be6063d1db0522592dde88b1c666499
Patch Set 1 #
Total comments: 18
Patch Set 2 : Record pending checks instead of pending clients because a client can send multiple Check* requests #Patch Set 3 : rebase #
Total comments: 6
Patch Set 4 : Resolve merge issue #Patch Set 5 : Don't care about timing out of SB check for redirect loops. #
Total comments: 3
Patch Set 6 : Now with a unit test! #
Total comments: 6
Patch Set 7 : Rebase and use the new fake GHPM in unit test #
Total comments: 2
Patch Set 8 : shess@ feedback #Patch Set 9 : git rebase manually! ugh. #
Messages
Total messages: 99 (62 generated)
The CQ bit was checked by vakh@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
vakh@chromium.org changed reviewers: + nparker@chromium.org, shess@chromium.org
If all the minidumps show that value to be '1', it'd confirm our suspicion about what's causing the mismatch between url and url_being_checked_.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... File chrome/browser/loader/safe_browsing_resource_throttle.cc (right): https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... chrome/browser/loader/safe_browsing_resource_throttle.cc:241: bool url_had_timed_out = base::ContainsValue(timed_out_urls_, url); A thought: If this disproves the theory, we might want additional data. Anything else you want to add? How about knowing if we've ever seen that URL on this client? Or maybe it's not necessary. https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... chrome/browser/loader/safe_browsing_resource_throttle.cc:402: // If the URL had timed out earlier but is being retried, remove it from the I don't think they can get retried. https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... chrome/browser/loader/safe_browsing_resource_throttle.cc:425: timed_out_urls_.push_back(url_being_checked_); nit: Would it work to just increment an timed_out_ counter?
Minor comments while I ponder what this means in the overall system. Could you contrive to cause a timeout, to verify that it can even get to the CHECK() section with this situation in place (|url| was previously timed out, I mean, regardless of whether |url| and |url_being_checked_| are the same). https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... File chrome/browser/loader/safe_browsing_resource_throttle.cc (right): https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... chrome/browser/loader/safe_browsing_resource_throttle.cc:242: char buf[1000]; Most of the minidumps I see are ~5M, so reducing this probably won't move the needle. But if the space is unnecessary, no harm. https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... chrome/browser/loader/safe_browsing_resource_throttle.cc:407: } timed_out_urls_.erase(std::remove(timed_out_urls_.begin(), timed_out_urls_.end(), url), timed_out_urls_.end()); OMG, STL is horrible. I mean, the version I suggest is obviously idiomatic in the context of STL, but the mapping from expression to concept is basically impenetrable. Sigh. It does make me wonder if std::set<> isn't in order. That would make this test and the presence test cleaner. I would guess that the overhead in the empty case would be comparable, and the single-element case would probably be slightly worse.
The CQ bit was checked by vakh@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Record pending checks instead of pending clients because a client can send multiple Check* requests
The CQ bit was checked by vakh@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-xco...)
Description was changed from ========== Dump whether the SB check for the URL returned by the DBManager had timed out Also, make the dump buffer smaller hoping to get more minidumps. BUG=660293 ========== to ========== Have a list of pending checks instead of pending clients since checks are unique, but clients aren't. Also, dump whether the SB check for the URL returned by the DBManager had timed out. Also, make the dump buffer smaller hoping to get more minidumps. BUG=660293 ==========
rebase
The CQ bit was checked by vakh@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The latest patch (ignoring rebase) contains the possible fix as well as debugging information (from patch 1) if it continues to fail. PTAL. https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... File chrome/browser/loader/safe_browsing_resource_throttle.cc (right): https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... chrome/browser/loader/safe_browsing_resource_throttle.cc:241: bool url_had_timed_out = base::ContainsValue(timed_out_urls_, url); On 2017/01/04 18:48:18, Nathan Parker wrote: > A thought: If this disproves the theory, we might want additional data. Anything > else you want to add? How about knowing if we've ever seen that URL on this > client? Or maybe it's not necessary. With the recent findings that I posted on http://crbug.com/660293 I am fairly confident that the issue should be fixed and in that case this code won't execute. So, at this point, the information that I am adding should be sufficient. https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... chrome/browser/loader/safe_browsing_resource_throttle.cc:242: char buf[1000]; On 2017/01/04 18:52:10, Scott Hess wrote: > Most of the minidumps I see are ~5M, so reducing this probably won't move the > needle. But if the space is unnecessary, no harm. Yes, but the buffer was too large and having the full URLs isn't helpful going forward. https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... chrome/browser/loader/safe_browsing_resource_throttle.cc:402: // If the URL had timed out earlier but is being retried, remove it from the On 2017/01/04 18:48:18, Nathan Parker wrote: > I don't think they can get retried. Quite possibly, but I don't understand the SBRT's code well enough to say that for sure. Since this code will be removed once I've fixed http://crbug.com/660293 I think it is OK to add it for now. https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... chrome/browser/loader/safe_browsing_resource_throttle.cc:407: } On 2017/01/04 18:52:10, Scott Hess wrote: > timed_out_urls_.erase(std::remove(timed_out_urls_.begin(), > timed_out_urls_.end(), url), timed_out_urls_.end()); > > OMG, STL is horrible. I mean, the version I suggest is obviously idiomatic in > the context of STL, but the mapping from expression to concept is basically > impenetrable. Sigh. > > It does make me wonder if std::set<> isn't in order. That would make this test > and the presence test cleaner. I would guess that the overhead in the empty > case would be comparable, and the single-element case would probably be slightly > worse. The STL version is so much harder understand, IMO. I much prefer readability. https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... chrome/browser/loader/safe_browsing_resource_throttle.cc:425: timed_out_urls_.push_back(url_being_checked_); On 2017/01/04 18:48:18, Nathan Parker wrote: > nit: Would it work to just increment an timed_out_ counter? Not sure how that would work since we need to compare the timed_out_urls_ with the url that's sent by V4LDBM in OnCheckBrowseUrlResult.
https://codereview.chromium.org/2616653002/diff/40001/components/safe_browsin... File components/safe_browsing_db/v4_local_database_manager.cc (right): https://codereview.chromium.org/2616653002/diff/40001/components/safe_browsin... components/safe_browsing_db/v4_local_database_manager.cc:165: [&client](const PendingCheck* check) { return check->client == client; }); Does capture-by-value (no &) work fine for client, here? I think that would look less interesting (in the "do I need to worry about that?" sense). https://codereview.chromium.org/2616653002/diff/40001/components/safe_browsin... components/safe_browsing_db/v4_local_database_manager.cc:539: pending_clients_.insert(check->client); Something going wrong, here. Perhaps a merge issue? If you're planning to move the pending_checks_ insert from here to PerformFullHashCheck(), note that that means that you could no longer cancel a check between when HandleCheck() is called and PerformFullHashCheck() is posted. Actually, I think it's reasonable to keep the check-in code here, because the fact that you need to pump things internally shouldn't be exposed to the clients.
Resolve merge issue
The CQ bit was checked by vakh@chromium.org to run a CQ dry run
https://codereview.chromium.org/2616653002/diff/40001/components/safe_browsin... File components/safe_browsing_db/v4_local_database_manager.cc (right): https://codereview.chromium.org/2616653002/diff/40001/components/safe_browsin... components/safe_browsing_db/v4_local_database_manager.cc:539: pending_clients_.insert(check->client); On 2017/01/06 00:42:02, Scott Hess wrote: > Something going wrong, here. Perhaps a merge issue? > > If you're planning to move the pending_checks_ insert from here to > PerformFullHashCheck(), note that that means that you could no longer cancel a > check between when HandleCheck() is called and PerformFullHashCheck() is posted. > > Actually, I think it's reasonable to keep the check-in code here, because the > fact that you need to pump things internally shouldn't be exposed to the > clients. Yup, bad merge. See new patch.
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... File chrome/browser/loader/safe_browsing_resource_throttle.cc (right): https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... chrome/browser/loader/safe_browsing_resource_throttle.cc:407: } On 2017/01/06 00:31:15, vakh (Varun Khaneja) wrote: > On 2017/01/04 18:52:10, Scott Hess wrote: > > timed_out_urls_.erase(std::remove(timed_out_urls_.begin(), > > timed_out_urls_.end(), url), timed_out_urls_.end()); > > > > OMG, STL is horrible. I mean, the version I suggest is obviously idiomatic in > > the context of STL, but the mapping from expression to concept is basically > > impenetrable. Sigh. > > > > It does make me wonder if std::set<> isn't in order. That would make this > test > > and the presence test cleaner. I would guess that the overhead in the empty > > case would be comparable, and the single-element case would probably be > slightly > > worse. > > The STL version is so much harder understand, IMO. I much prefer readability. ACK on the erase(remove()) idiom, but what did you think about using a set in the first place so that the operations are all simpler?
https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... File chrome/browser/loader/safe_browsing_resource_throttle.cc (right): https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... chrome/browser/loader/safe_browsing_resource_throttle.cc:407: } > ACK on the erase(remove()) idiom, but what did you think about using a set in > the first place so that the operations are all simpler? Sorry, I missed that. As far as I can tell, ordered_set::find and set::find have the exact same syntax. Do you mean that we can replace ordered_set::find with a completely different std::set API that's simpler than find?
vakh@chromium.org changed reviewers: + csharrison@chromium.org
csharrison@ -- could you please review the changes in safe_browsing_resource_throttle.*? Thanks.
lgtm How about some tests that validate the bug is fixed? https://codereview.chromium.org/2616653002/diff/40001/chrome/browser/loader/s... File chrome/browser/loader/safe_browsing_resource_throttle.cc (right): https://codereview.chromium.org/2616653002/diff/40001/chrome/browser/loader/s... chrome/browser/loader/safe_browsing_resource_throttle.cc:405: if (iter != timed_out_urls_.end()) { same comment I had before: I don't think a URL can be "retried" here, unless it's in a redirect loop.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Don't care about timing out of SB check for redirect loops.
The CQ bit was checked by vakh@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2616653002/diff/40001/chrome/browser/loader/s... File chrome/browser/loader/safe_browsing_resource_throttle.cc (right): https://codereview.chromium.org/2616653002/diff/40001/chrome/browser/loader/s... chrome/browser/loader/safe_browsing_resource_throttle.cc:405: if (iter != timed_out_urls_.end()) { On 2017/01/06 01:41:01, Nathan Parker wrote: > same comment I had before: I don't think a URL can be "retried" here, unless > it's in a redirect loop. There you go! I agree that caring for SB check timeout of a redirect loop is a very uncommon scenario and should be avoided as such. However, from the minidumps I did see cases when the url and url_being_checked_ could not have been just redirects. For instance, in crash/1dc61c4080000000: url: http://assets.bounceexchange.com/fonts/raleway_700_bold_normal/stylesheet.css and url_being_checked_: http://assets.bounceexchange.com/fonts/raleway_700_bold_normal/raleway-bold-2... That can't be a simple redirect. My point is that it seems like the same client object can be used to check the reputation of multiple URLs, not just due to redirects. And in that case, it is entirely possible for the same URL to re-appear for the same client object more than once without redirect loops. In any case, I have removed this code to make it less contentious. I can always add it back if needed later.
https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... File chrome/browser/loader/safe_browsing_resource_throttle.cc (right): https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... chrome/browser/loader/safe_browsing_resource_throttle.cc:407: } On 2017/01/06 01:05:50, vakh (Varun Khaneja) wrote: > > ACK on the erase(remove()) idiom, but what did you think about using a set in > > the first place so that the operations are all simpler? > > Sorry, I missed that. > As far as I can tell, ordered_set::find and set::find have the exact same > syntax. Do you mean that we can replace ordered_set::find with a completely > different std::set API that's simpler than find? I mean for timed_out_urls_. So that this code can be: timed_out_urls_.erase(url); and the check code can be: bool url_had_timed_out = (timed_out_urls_.count(url) > 0); std::vector doesn't seem to be a great fit, given that this shouldn't fire that often.
https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... File chrome/browser/loader/safe_browsing_resource_throttle.cc (right): https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... chrome/browser/loader/safe_browsing_resource_throttle.cc:407: } On 2017/01/06 02:42:27, Scott Hess wrote: > On 2017/01/06 01:05:50, vakh (Varun Khaneja) wrote: > > > ACK on the erase(remove()) idiom, but what did you think about using a set > in > > > the first place so that the operations are all simpler? > > > > Sorry, I missed that. > > As far as I can tell, ordered_set::find and set::find have the exact same > > syntax. Do you mean that we can replace ordered_set::find with a completely > > different std::set API that's simpler than find? > > I mean for timed_out_urls_. So that this code can be: > timed_out_urls_.erase(url); > and the check code can be: > bool url_had_timed_out = (timed_out_urls_.count(url) > 0); > std::vector doesn't seem to be a great fit, given that this shouldn't fire that > often. Gah, I don't know why I am talking nonsense. You're right that std::set would have been easier. However, I have removed that code for now since it is highly unlikely that the same client would be re-used to re-try a URL that had previously timed-out.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... File chrome/browser/loader/safe_browsing_resource_throttle.cc (right): https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... chrome/browser/loader/safe_browsing_resource_throttle.cc:407: } On 2017/01/06 02:46:59, vakh (Varun Khaneja) wrote: > On 2017/01/06 02:42:27, Scott Hess wrote: > > On 2017/01/06 01:05:50, vakh (Varun Khaneja) wrote: > > > > ACK on the erase(remove()) idiom, but what did you think about using a set > > in > > > > the first place so that the operations are all simpler? > > > > > > Sorry, I missed that. > > > As far as I can tell, ordered_set::find and set::find have the exact same > > > syntax. Do you mean that we can replace ordered_set::find with a completely > > > different std::set API that's simpler than find? > > > > I mean for timed_out_urls_. So that this code can be: > > timed_out_urls_.erase(url); > > and the check code can be: > > bool url_had_timed_out = (timed_out_urls_.count(url) > 0); > > std::vector doesn't seem to be a great fit, given that this shouldn't fire > that > > often. > > Gah, I don't know why I am talking nonsense. > You're right that std::set would have been easier. > > However, I have removed that code for now since it is highly unlikely that the > same client > would be re-used to re-try a URL that had previously timed-out. That's an even better solution!
nit: could you wrap your CL title/description to 80 cols? https://codereview.chromium.org/2616653002/diff/80001/chrome/browser/loader/s... File chrome/browser/loader/safe_browsing_resource_throttle.h (right): https://codereview.chromium.org/2616653002/diff/80001/chrome/browser/loader/s... chrome/browser/loader/safe_browsing_resource_throttle.h:174: std::vector<GURL> timed_out_urls_; Do we really need the GURL copies here? The URLRequest already stores its redirect chain, and we store a copy of it above too (is that really necessary?).
Now with a unit test!
The CQ bit was checked by vakh@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Now with a unit test!
The CQ bit was checked by vakh@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #6 (id:100001) has been deleted
Now with a unit test!
The CQ bit was checked by vakh@chromium.org to run a CQ dry run
Patchset #6 (id:120001) has been deleted
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Now with a unit test!
The CQ bit was checked by vakh@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #6 (id:140001) has been deleted
Description was changed from ========== Have a list of pending checks instead of pending clients since checks are unique, but clients aren't. Also, dump whether the SB check for the URL returned by the DBManager had timed out. Also, make the dump buffer smaller hoping to get more minidumps. BUG=660293 ========== to ========== Have a list of pending checks instead of pending clients since checks are unique, but clients aren't. Also, dump whether the SB check for the URL returned by the DBManager had timed out. Also, make the dump buffer smaller hoping to get more minidumps. BUG=660293 ==========
nparker: test added. Also confirmed that this test fails if I do not apply the patch. csharrison: wrapped to 80 cols. Thanks. PTAL. https://codereview.chromium.org/2616653002/diff/40001/components/safe_browsin... File components/safe_browsing_db/v4_local_database_manager.cc (right): https://codereview.chromium.org/2616653002/diff/40001/components/safe_browsin... components/safe_browsing_db/v4_local_database_manager.cc:165: [&client](const PendingCheck* check) { return check->client == client; }); On 2017/01/06 00:42:02, Scott Hess wrote: > Does capture-by-value (no &) work fine for client, here? I think that would > look less interesting (in the "do I need to worry about that?" sense). Done. https://codereview.chromium.org/2616653002/diff/80001/chrome/browser/loader/s... File chrome/browser/loader/safe_browsing_resource_throttle.h (right): https://codereview.chromium.org/2616653002/diff/80001/chrome/browser/loader/s... chrome/browser/loader/safe_browsing_resource_throttle.h:174: std::vector<GURL> timed_out_urls_; On 2017/01/06 16:53:00, Charlie Harrison wrote: > Do we really need the GURL copies here? > > The URLRequest already stores its redirect chain, and we store a copy of it > above too (is that really necessary?). You mean just store references to those GURLs? For a couple of reasons: 1. It isn't clear, to me, if the SafeBrowsingResourceThrottle's lifetime is the same as, or is greater than the URLRequest. 2. The vector will only ever be populated if the SafeBrowsing check times out. This isn't a common occurrence. 3. This code is being added for diagnostic purposes and will be removed shortly afterwards so optimizing it has very limited value.
https://codereview.chromium.org/2616653002/diff/160001/components/safe_browsi... File components/safe_browsing_db/v4_local_database_manager_unittest.cc (right): https://codereview.chromium.org/2616653002/diff/160001/components/safe_browsi... components/safe_browsing_db/v4_local_database_manager_unittest.cc:122: void WaitForTasksOnTaskRunner() { Make private, or better yet just inline it. https://codereview.chromium.org/2616653002/diff/160001/components/safe_browsi... components/safe_browsing_db/v4_local_database_manager_unittest.cc:132: WaitForTasksOnTaskRunner(); I'm not clear on why this is necessary -- the one at the end of ReplaceV4Database should ensure you're in a known state, ya? https://codereview.chromium.org/2616653002/diff/160001/components/safe_browsi... components/safe_browsing_db/v4_local_database_manager_unittest.cc:659: // See http://crbug.com/660293 nit: "This verifies the fix for race in http://...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2616653002/diff/80001/chrome/browser/loader/s... File chrome/browser/loader/safe_browsing_resource_throttle.h (right): https://codereview.chromium.org/2616653002/diff/80001/chrome/browser/loader/s... chrome/browser/loader/safe_browsing_resource_throttle.h:174: std::vector<GURL> timed_out_urls_; On 2017/01/09 19:21:32, vakh (Varun Khaneja) wrote: > On 2017/01/06 16:53:00, Charlie Harrison wrote: > > Do we really need the GURL copies here? > > > > The URLRequest already stores its redirect chain, and we store a copy of it > > above too (is that really necessary?). > > You mean just store references to those GURLs? > For a couple of reasons: > 1. It isn't clear, to me, if the SafeBrowsingResourceThrottle's lifetime is the > same as, or is greater than the URLRequest. A resource throttle is owned by a ThrottlingResourceHandler. Resource handler has the following class comment: "A ResourceHandler's lifetime is bound to its associated URLRequest". So I think we should be fine here. > 2. The vector will only ever be populated if the SafeBrowsing check times out. > This isn't a common occurrence. Ack. > 3. This code is being added for diagnostic purposes and will be removed shortly > afterwards so optimizing it has very limited value. As long as this is true, LGTM. I would be very interested in removing the redirect_urls_ vector as well in the future though. URLs can be big (up to 2MB each), so adding more places where we log redirects in the browser process makes me nervous.
Rebase and use the new fake GHPM in unit test
The CQ bit was checked by vakh@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2616653002/diff/160001/components/safe_browsi... File components/safe_browsing_db/v4_local_database_manager_unittest.cc (right): https://codereview.chromium.org/2616653002/diff/160001/components/safe_browsi... components/safe_browsing_db/v4_local_database_manager_unittest.cc:122: void WaitForTasksOnTaskRunner() { On 2017/01/09 19:46:28, Nathan Parker wrote: > Make private, or better yet just inline it. Removed https://codereview.chromium.org/2616653002/diff/160001/components/safe_browsi... components/safe_browsing_db/v4_local_database_manager_unittest.cc:132: WaitForTasksOnTaskRunner(); On 2017/01/09 19:46:28, Nathan Parker wrote: > I'm not clear on why this is necessary -- the one at the end of > ReplaceV4Database should ensure you're in a known state, ya? Removed https://codereview.chromium.org/2616653002/diff/160001/components/safe_browsi... components/safe_browsing_db/v4_local_database_manager_unittest.cc:659: // See http://crbug.com/660293 On 2017/01/09 19:46:28, Nathan Parker wrote: > nit: "This verifies the fix for race in http://... Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: cast_shell_linux on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL)
https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... File chrome/browser/loader/safe_browsing_resource_throttle.cc (right): https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... chrome/browser/loader/safe_browsing_resource_throttle.cc:407: } On 2017/01/06 04:27:18, Scott Hess wrote: > On 2017/01/06 02:46:59, vakh (Varun Khaneja) wrote: > > On 2017/01/06 02:42:27, Scott Hess wrote: > > > On 2017/01/06 01:05:50, vakh (Varun Khaneja) wrote: > > > > > ACK on the erase(remove()) idiom, but what did you think about using a > set > > > in > > > > > the first place so that the operations are all simpler? > > > > > > > > Sorry, I missed that. > > > > As far as I can tell, ordered_set::find and set::find have the exact same > > > > syntax. Do you mean that we can replace ordered_set::find with a > completely > > > > different std::set API that's simpler than find? > > > > > > I mean for timed_out_urls_. So that this code can be: > > > timed_out_urls_.erase(url); > > > and the check code can be: > > > bool url_had_timed_out = (timed_out_urls_.count(url) > 0); > > > std::vector doesn't seem to be a great fit, given that this shouldn't fire > > that > > > often. > > > > Gah, I don't know why I am talking nonsense. > > You're right that std::set would have been easier. > > > > However, I have removed that code for now since it is highly unlikely that the > > same client > > would be re-used to re-try a URL that had previously timed-out. > > That's an even better solution! I took this thread to mean that you had removed the code related to timed_out_urls_, but I still see that code? In order of importance to me: 1) Remove the timed_out_urls_ code, maybe saving it locally just-in-case. 2) Obvious conversion to std::set. 3) Some sort of argument why my std::set suggestion is silly. Honestly, I like #1, because then I can just OK things and you can land things and the crash server can evaluate things. https://codereview.chromium.org/2616653002/diff/180001/components/safe_browsi... File components/safe_browsing_db/v4_local_database_manager.cc (right): https://codereview.chromium.org/2616653002/diff/180001/components/safe_browsi... components/safe_browsing_db/v4_local_database_manager.cc:539: pending_checks_.insert(check.get()); Did this intentionally move above the comment? I'd go with either below the comment like before, or above the comment, with a comment as to why it's entered here, plus a line of whitespace betwee. Mostly because I'm OCD about it being whitespace, comment, code.
The CQ bit was checked by vakh@chromium.org to run a CQ dry run
shess@ feedback
The CQ bit was checked by vakh@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Thanks. PTAL. https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... File chrome/browser/loader/safe_browsing_resource_throttle.cc (right): https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... chrome/browser/loader/safe_browsing_resource_throttle.cc:407: } On 2017/01/10 21:16:12, Scott Hess wrote: > On 2017/01/06 04:27:18, Scott Hess wrote: > > On 2017/01/06 02:46:59, vakh (Varun Khaneja) wrote: > > > On 2017/01/06 02:42:27, Scott Hess wrote: > > > > On 2017/01/06 01:05:50, vakh (Varun Khaneja) wrote: > > > > > > ACK on the erase(remove()) idiom, but what did you think about using a > > set > > > > in > > > > > > the first place so that the operations are all simpler? > > > > > > > > > > Sorry, I missed that. > > > > > As far as I can tell, ordered_set::find and set::find have the exact > same > > > > > syntax. Do you mean that we can replace ordered_set::find with a > > completely > > > > > different std::set API that's simpler than find? > > > > > > > > I mean for timed_out_urls_. So that this code can be: > > > > timed_out_urls_.erase(url); > > > > and the check code can be: > > > > bool url_had_timed_out = (timed_out_urls_.count(url) > 0); > > > > std::vector doesn't seem to be a great fit, given that this shouldn't fire > > > that > > > > often. > > > > > > Gah, I don't know why I am talking nonsense. > > > You're right that std::set would have been easier. > > > > > > However, I have removed that code for now since it is highly unlikely that > the > > > same client > > > would be re-used to re-try a URL that had previously timed-out. > > > > That's an even better solution! > > I took this thread to mean that you had removed the code related to > timed_out_urls_, but I still see that code? > > In order of importance to me: > 1) Remove the timed_out_urls_ code, maybe saving it locally just-in-case. > 2) Obvious conversion to std::set. > 3) Some sort of argument why my std::set suggestion is silly. > > Honestly, I like #1, because then I can just OK things and you can land things > and the crash server can evaluate things. Changed to std::set but, frankly, I think it doesn't matter one way or the other, given how uncommon this scenario is and how short-lived (<15 days) this code is going to be. https://codereview.chromium.org/2616653002/diff/180001/components/safe_browsi... File components/safe_browsing_db/v4_local_database_manager.cc (right): https://codereview.chromium.org/2616653002/diff/180001/components/safe_browsi... components/safe_browsing_db/v4_local_database_manager.cc:539: pending_checks_.insert(check.get()); On 2017/01/10 21:16:13, Scott Hess wrote: > Did this intentionally move above the comment? > > I'd go with either below the comment like before, or above the comment, with a > comment as to why it's entered here, plus a line of whitespace betwee. Mostly > because I'm OCD about it being whitespace, comment, code. Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-xco...)
lgtm https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... File chrome/browser/loader/safe_browsing_resource_throttle.cc (right): https://codereview.chromium.org/2616653002/diff/1/chrome/browser/loader/safe_... chrome/browser/loader/safe_browsing_resource_throttle.cc:407: } On 2017/01/10 21:38:08, vakh (Varun Khaneja) wrote: > Changed to std::set but, frankly, I think it doesn't matter one way or the > other, given how uncommon this scenario is and how short-lived (<15 days) this > code is going to be. Oh, I agree it doesn't matter. But assume the worst when checking things in...
git rebase manually! ugh.
The CQ bit was checked by vakh@chromium.org to run a CQ dry run
Patchset #9 (id:220001) has been deleted
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
git rebase manually! ugh.
The CQ bit was checked by vakh@chromium.org to run a CQ dry run
Patchset #9 (id:240001) has been deleted
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by vakh@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from nparker@chromium.org, csharrison@chromium.org, shess@chromium.org Link to the patchset: https://codereview.chromium.org/2616653002/#ps260001 (title: "git rebase manually! ugh.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 260001, "attempt_start_ts": 1484087978877250, "parent_rev": "67e0a1510f8a824b0e07c61484bc55c28c2f6c86", "commit_rev": "9f5bdb322be6063d1db0522592dde88b1c666499"}
Message was sent while issue was closed.
Description was changed from ========== Have a list of pending checks instead of pending clients since checks are unique, but clients aren't. Also, dump whether the SB check for the URL returned by the DBManager had timed out. Also, make the dump buffer smaller hoping to get more minidumps. BUG=660293 ========== to ========== Have a list of pending checks instead of pending clients since checks are unique, but clients aren't. Also, dump whether the SB check for the URL returned by the DBManager had timed out. Also, make the dump buffer smaller hoping to get more minidumps. BUG=660293 Review-Url: https://codereview.chromium.org/2616653002 Cr-Commit-Position: refs/heads/master@{#442731} Committed: https://chromium.googlesource.com/chromium/src/+/9f5bdb322be6063d1db0522592dd... ==========
Message was sent while issue was closed.
Committed patchset #9 (id:260001) as https://chromium.googlesource.com/chromium/src/+/9f5bdb322be6063d1db0522592dd... |