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

Issue 10695110: Avoid disk accesses on the wrong thread in URLRequestFileJob (Closed)

Created:
8 years, 5 months ago by pivanof
Modified:
8 years, 1 month ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org
Base URL:
https://src.chromium.org/chrome/trunk/src/
Visibility:
Public.

Description

Avoid disk accesses on the wrong thread in URLRequestFileJob while opening and positioning in the file. Patch from Pavel Ivanov <paivanof@gmail.com>; BUG=59849, 114783 TEST=net_unittests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=168626

Patch Set 1 #

Patch Set 2 : #

Total comments: 3

Patch Set 3 : #

Total comments: 2

Patch Set 4 : #

Total comments: 14

Patch Set 5 : #

Patch Set 6 : #

Total comments: 6

Patch Set 7 : Avoid disk accesses on the wrong thread in URLRequestFileJob #

Total comments: 17

Patch Set 8 : #

Patch Set 9 : #

Total comments: 2

Patch Set 10 : #

Patch Set 11 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+133 lines, -103 lines) Patch
M net/url_request/url_request_file_job.h View 1 2 3 4 5 6 7 8 2 chunks +34 lines, -7 lines 0 comments Download
M net/url_request/url_request_file_job.cc View 1 2 3 4 5 6 7 8 9 10 8 chunks +81 lines, -96 lines 2 comments Download
M net/url_request/url_request_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +18 lines, -0 lines 0 comments Download

Messages

Total messages: 32 (0 generated)
pivanof
This patch is based on changes in https://chromiumcodereview.appspot.com/10701050/.
8 years, 5 months ago (2012-07-06 04:16:34 UTC) #1
eroman
Hi Pavel, there were no comments on this review yet because were were all on ...
8 years, 5 months ago (2012-07-10 22:16:52 UTC) #2
eroman
LGTM. I haven't reviewed the dependent changelist which introduces CloseAndCancelAsync(), but its usage here looks ...
8 years, 5 months ago (2012-07-10 23:50:56 UTC) #3
pivanof
Thanks eroman. I'll adjust the patch but could you please also look at my comments ...
8 years, 5 months ago (2012-07-11 01:31:01 UTC) #4
eroman
> But it turns out I can't call GetMimeTypeFromFile() in > WorkerPool. What thread I ...
8 years, 5 months ago (2012-07-11 18:42:32 UTC) #5
pivanof
I've update the patch and included changes in GetMimeType(). On 2012/07/11 18:42:32, eroman wrote: > ...
8 years, 5 months ago (2012-07-12 01:18:04 UTC) #6
eroman
https://chromiumcodereview.appspot.com/10695110/diff/8003/net/base/mime_util.cc File net/base/mime_util.cc (right): https://chromiumcodereview.appspot.com/10695110/diff/8003/net/base/mime_util.cc#newcode89 net/base/mime_util.cc:89: static base::LazyInstance<MimeUtil>::Leaky g_mime_util = Please add a comment explaining ...
8 years, 5 months ago (2012-07-12 19:13:15 UTC) #7
pivanof
On 2012/07/12 19:13:15, eroman wrote: > https://chromiumcodereview.appspot.com/10695110/diff/8003/net/url_request/url_request_file_job.cc > File net/url_request/url_request_file_job.cc (right): > > https://chromiumcodereview.appspot.com/10695110/diff/8003/net/url_request/url_request_file_job.cc#newcode101 > ...
8 years, 5 months ago (2012-07-13 01:35:10 UTC) #8
eroman
LGTM. I'll give the dependent review a look over: if I feel qualified I can ...
8 years, 5 months ago (2012-07-13 02:05:01 UTC) #9
wtc
Review comments on patch set 4: https://chromiumcodereview.appspot.com/10695110/diff/1004/net/base/mime_util.cc File net/base/mime_util.cc (right): https://chromiumcodereview.appspot.com/10695110/diff/1004/net/base/mime_util.cc#newcode89 net/base/mime_util.cc:89: // This variable ...
8 years, 5 months ago (2012-07-13 22:38:55 UTC) #10
pivanof
https://chromiumcodereview.appspot.com/10695110/diff/1004/net/url_request/url_request_file_job.cc File net/url_request/url_request_file_job.cc (right): https://chromiumcodereview.appspot.com/10695110/diff/1004/net/url_request/url_request_file_job.cc#newcode85 net/url_request/url_request_file_job.cc:85: FileMetaInfo* meta_info = new FileMetaInfo; On 2012/07/13 22:38:55, wtc ...
8 years, 5 months ago (2012-07-13 23:51:21 UTC) #11
pivanof
https://chromiumcodereview.appspot.com/10695110/diff/1004/net/url_request/url_request_file_job.cc File net/url_request/url_request_file_job.cc (right): https://chromiumcodereview.appspot.com/10695110/diff/1004/net/url_request/url_request_file_job.cc#newcode287 net/url_request/url_request_file_job.cc:287: DidSeek(-1); On 2012/07/13 23:51:21, pivanof wrote: > On 2012/07/13 ...
8 years, 5 months ago (2012-07-14 02:28:45 UTC) #12
pivanof
On 2012/07/13 23:51:21, pivanof wrote: > https://chromiumcodereview.appspot.com/10695110/diff/1004/net/url_request/url_request_file_job.cc > File net/url_request/url_request_file_job.cc (right): > > https://chromiumcodereview.appspot.com/10695110/diff/1004/net/url_request/url_request_file_job.cc#newcode184 > ...
8 years, 5 months ago (2012-07-14 03:02:59 UTC) #13
wtc
Review comments on patch set 6: Thanks for updating the CL. Just some coding style ...
8 years, 4 months ago (2012-08-09 16:05:42 UTC) #14
pivanof
Avoid disk accesses on the wrong thread in URLRequestFileJob while opening and positioning in the ...
8 years, 4 months ago (2012-08-14 06:11:23 UTC) #15
pivanof
I've updated the CL. On 2012/08/09 16:05:42, wtc wrote: > http://codereview.chromium.org/10695110/diff/24001/net/url_request/url_request_file_job.h#newcode91 > net/url_request/url_request_file_job.h:91: // Callback ...
8 years, 4 months ago (2012-08-14 06:16:59 UTC) #16
wtc
Patch set 7 LGTM. Thanks! I reviewed the CL again because I forgot what it ...
8 years, 4 months ago (2012-08-14 18:00:40 UTC) #17
pivanof
On 2012/08/14 18:00:40, wtc wrote: > paivanof wrote: > > > > I didn't like ...
8 years, 4 months ago (2012-08-15 06:36:50 UTC) #18
wtc
http://codereview.chromium.org/10695110/diff/31001/net/url_request/url_request_file_job.cc File net/url_request/url_request_file_job.cc (right): http://codereview.chromium.org/10695110/diff/31001/net/url_request/url_request_file_job.cc#newcode297 net/url_request/url_request_file_job.cc:297: // to be (it won't be true only when ...
8 years, 4 months ago (2012-08-17 00:24:04 UTC) #19
pivanof
eroman, wtc: Now that https://chromiumcodereview.appspot.com/10701050/ is committed I rebased this CL and it's ready to ...
8 years, 1 month ago (2012-11-14 05:21:31 UTC) #20
wtc
Patch set 9 LGTM. I only reviewed the diffs between patch sets 7 and 9. ...
8 years, 1 month ago (2012-11-14 21:05:00 UTC) #21
pivanof
On 2012/11/14 21:05:00, wtc wrote: > https://codereview.chromium.org/10695110/diff/31001/net/url_request/url_request_file_job.cc > File net/url_request/url_request_file_job.cc (right): > > https://codereview.chromium.org/10695110/diff/31001/net/url_request/url_request_file_job.cc#newcode232 > ...
8 years, 1 month ago (2012-11-15 00:24:41 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/paivanof@gmail.com/10695110/44004
8 years, 1 month ago (2012-11-16 22:33:52 UTC) #23
wtc
Patch set 10 LGTM. Thanks. https://codereview.chromium.org/10695110/diff/31001/net/url_request/url_request_file_job.cc File net/url_request/url_request_file_job.cc (right): https://codereview.chromium.org/10695110/diff/31001/net/url_request/url_request_file_job.cc#newcode232 net/url_request/url_request_file_job.cc:232: meta_info->is_directory = platform_info.is_directory; pivanof ...
8 years, 1 month ago (2012-11-17 02:15:29 UTC) #24
pivanof
On 2012/11/17 02:15:29, wtc wrote: > pivanof wrote: > > Done. But why do you ...
8 years, 1 month ago (2012-11-17 07:27:02 UTC) #25
wtc
Patch set 11 LGTM. Thanks. https://codereview.chromium.org/10695110/diff/52014/net/url_request/url_request_file_job.cc File net/url_request/url_request_file_job.cc (right): https://codereview.chromium.org/10695110/diff/52014/net/url_request/url_request_file_job.cc#newcode94 net/url_request/url_request_file_job.cc:94: FileMetaInfo* meta_info = new ...
8 years, 1 month ago (2012-11-19 19:48:01 UTC) #26
pivanof
On 2012/11/19 19:48:01, wtc wrote: > https://codereview.chromium.org/10695110/diff/52014/net/url_request/url_request_file_job.cc > File net/url_request/url_request_file_job.cc (right): > > https://codereview.chromium.org/10695110/diff/52014/net/url_request/url_request_file_job.cc#newcode94 > ...
8 years, 1 month ago (2012-11-19 19:53:43 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/paivanof@gmail.com/10695110/52014
8 years, 1 month ago (2012-11-19 19:54:22 UTC) #28
commit-bot: I haz the power
Change committed as 168626
8 years, 1 month ago (2012-11-19 23:28:45 UTC) #29
hashimoto
This change made URLRequestTest.FileTestMultipleRanges faling on some Win bots. http://build.chromium.org/p/chromium.win/builders/XP%20Tests%20%28dbg%29%282%29/builds/23670/steps/net_unittests/logs/FileTestMultipleRanges In that test, events are ...
8 years, 1 month ago (2012-11-20 02:18:45 UTC) #30
wtc
hashimoto: thank you for letting us know and reverting this CL. pivanof: I think I ...
8 years, 1 month ago (2012-11-20 20:56:55 UTC) #31
pivanof
8 years, 1 month ago (2012-11-20 22:43:56 UTC) #32
Actually it looks to me that the problem actually wasn't introduced by this
commit, it probably was introduced by
https://chromiumcodereview.appspot.com/10701050/. Maybe this commit just
aggravated some race and it became visible.
I think what happens is URLRequestFileJob opens FileStream for the temporary
file, then it calls NotifyDone with error, then either Kill() or destructor is
called. But FileStream doesn't close file in destructor, it puts job into
WorkerPool that will eventually close file. But before it has a chance to do
that test is checking on the main thread that it can delete the file and it
fails. I think this deletion check in the test is invalid and should be removed.
I'm not sure what to do with temporary file though, how to eventually delete it
and not leave in filesystem after test is finished.

Powered by Google App Engine
This is Rietveld 408576698