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

Issue 829553002: [fsp] Add throttling for number of opened files. (Closed)

Created:
5 years, 12 months ago by mtomasz
Modified:
5 years, 11 months ago
Reviewers:
hirono
CC:
chromium-reviews, stevenjb+watch_chromium.org, davemoore+watch_chromium.org, oshima+watch_chromium.org, nkostylev+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[fsp] Add throttling for number of opened files. This patch adds a limit for number of opened files at once. The reason for that is that provided file systems may not support multiple opened files per once due to performance reasons. Enqueuing files is on the extension side is complicated as extensions are event pages, and state may get lost after a suspend. Note, that this CL only adds the C++ side. The opened_files_limit option is not exposed via File System Provider API yet. This will be done separately. Finally, the Queue class will be reused for enqueuing watcher events, which are currently not safe (there are TODO about adding a queue). This will be also done separately. TEST=unit_tests: *FileSystemProviderQueue*, *FileSystemProviderThrottled* BUG=445125 Committed: https://crrev.com/3dd2edf4a117d03d2ec45bb3dcf205cb7561a7e1 Cr-Commit-Position: refs/heads/master@{#310717}

Patch Set 1 #

Patch Set 2 : Added a lot. #

Patch Set 3 : Added throttled file system tests. #

Patch Set 4 : Fixed aborting, simplified queue. #

Patch Set 5 : Added a comment. #

Total comments: 16

Patch Set 6 : Addressed comments. #

Patch Set 7 : Fixed ASAN. #

Total comments: 6

Patch Set 8 : Converted returns into DCHECKs. #

Total comments: 12

Patch Set 9 : Addressed comments. #

Patch Set 10 : int -> size_t. #

Total comments: 2

Patch Set 11 : Fixed DCHECK position. #

Patch Set 12 : Fixed. #

Patch Set 13 : Rebased. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1105 lines, -167 lines) Patch
A chrome/browser/chromeos/file_system_provider/abort_callback.h View 1 1 chunk +20 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc View 1 14 chunks +16 lines, -19 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/provided_file_system.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/provided_file_system.cc View 1 14 chunks +16 lines, -17 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/provided_file_system_info.h View 1 2 3 4 5 6 7 8 9 3 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/provided_file_system_info.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +7 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h View 1 2 chunks +1 line, -3 lines 0 comments Download
A chrome/browser/chromeos/file_system_provider/queue.h View 1 2 3 4 5 6 7 8 9 1 chunk +99 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/file_system_provider/queue.cc View 1 2 3 4 5 6 7 8 9 1 chunk +119 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/file_system_provider/queue_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +324 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/registry.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/registry.cc View 1 2 3 4 5 6 7 8 9 4 chunks +21 lines, -11 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/registry_unittest.cc View 1 2 3 4 5 6 7 8 9 8 chunks +18 lines, -14 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/service.cc View 1 2 chunks +3 lines, -1 line 0 comments Download
A + chrome/browser/chromeos/file_system_provider/throttled_file_system.h View 1 2 3 4 5 6 7 2 chunks +41 lines, -90 lines 0 comments Download
A chrome/browser/chromeos/file_system_provider/throttled_file_system.cc View 1 2 3 4 5 6 7 8 9 1 chunk +218 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/file_system_provider/throttled_file_system_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +177 lines, -0 lines 0 comments Download
M chrome/chrome_browser_chromeos.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +5 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (4 generated)
mtomasz
@hirono: PTAL. Thanks. Sorry a for large CL.
5 years, 11 months ago (2015-01-07 05:52:14 UTC) #2
hirono
https://codereview.chromium.org/829553002/diff/80001/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.cc File chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.cc (right): https://codereview.chromium.org/829553002/diff/80001/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.cc#newcode147 chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.cc:147: last_abort_callback.Run(base::Bind( Can we ensure last_abort_callback.is_null() == false? How about ...
5 years, 11 months ago (2015-01-07 06:57:37 UTC) #3
hirono
https://codereview.chromium.org/829553002/diff/80001/chrome/browser/chromeos/file_system_provider/queue.h File chrome/browser/chromeos/file_system_provider/queue.h (right): https://codereview.chromium.org/829553002/diff/80001/chrome/browser/chromeos/file_system_provider/queue.h#newcode54 chrome/browser/chromeos/file_system_provider/queue.h:54: AbortCallback Enqueue(int token, const AbortableCallback& callback); Could you also ...
5 years, 11 months ago (2015-01-07 07:20:05 UTC) #4
mtomasz
Thanks! https://codereview.chromium.org/829553002/diff/80001/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.cc File chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.cc (right): https://codereview.chromium.org/829553002/diff/80001/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.cc#newcode147 chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.cc:147: last_abort_callback.Run(base::Bind( On 2015/01/07 06:57:36, hirono wrote: > Can ...
5 years, 11 months ago (2015-01-07 09:08:41 UTC) #5
hirono
https://codereview.chromium.org/829553002/diff/80001/chrome/browser/chromeos/file_system_provider/queue.h File chrome/browser/chromeos/file_system_provider/queue.h (right): https://codereview.chromium.org/829553002/diff/80001/chrome/browser/chromeos/file_system_provider/queue.h#newcode64 chrome/browser/chromeos/file_system_provider/queue.h:64: bool Remove(int token); On 2015/01/07 09:08:41, mtomasz wrote: > ...
5 years, 11 months ago (2015-01-07 10:34:29 UTC) #6
mtomasz
https://codereview.chromium.org/829553002/diff/80001/chrome/browser/chromeos/file_system_provider/queue.h File chrome/browser/chromeos/file_system_provider/queue.h (right): https://codereview.chromium.org/829553002/diff/80001/chrome/browser/chromeos/file_system_provider/queue.h#newcode64 chrome/browser/chromeos/file_system_provider/queue.h:64: bool Remove(int token); On 2015/01/07 10:34:29, hirono wrote: > ...
5 years, 11 months ago (2015-01-08 02:18:27 UTC) #7
hirono
This is the last round. Thanks! https://codereview.chromium.org/829553002/diff/140001/chrome/browser/chromeos/file_system_provider/queue.cc File chrome/browser/chromeos/file_system_provider/queue.cc (right): https://codereview.chromium.org/829553002/diff/140001/chrome/browser/chromeos/file_system_provider/queue.cc#newcode41 chrome/browser/chromeos/file_system_provider/queue.cc:41: pending_.push_back(Task(token, callback)); nit: ...
5 years, 11 months ago (2015-01-08 06:28:09 UTC) #8
mtomasz
https://codereview.chromium.org/829553002/diff/140001/chrome/browser/chromeos/file_system_provider/queue.cc File chrome/browser/chromeos/file_system_provider/queue.cc (right): https://codereview.chromium.org/829553002/diff/140001/chrome/browser/chromeos/file_system_provider/queue.cc#newcode41 chrome/browser/chromeos/file_system_provider/queue.cc:41: pending_.push_back(Task(token, callback)); On 2015/01/08 06:28:09, hirono wrote: > nit: ...
5 years, 11 months ago (2015-01-08 07:07:50 UTC) #9
hirono
lgtm with a nit! Thanks! https://codereview.chromium.org/829553002/diff/140001/chrome/browser/chromeos/file_system_provider/queue.cc File chrome/browser/chromeos/file_system_provider/queue.cc (right): https://codereview.chromium.org/829553002/diff/140001/chrome/browser/chromeos/file_system_provider/queue.cc#newcode63 chrome/browser/chromeos/file_system_provider/queue.cc:63: if (executed_.size() == static_cast<size_t>(max_in_parallel_) ...
5 years, 11 months ago (2015-01-08 07:35:29 UTC) #10
mtomasz
Done. I also updated tests in registry_unittest.cc. PTAL. Thanks! https://codereview.chromium.org/829553002/diff/140001/chrome/browser/chromeos/file_system_provider/queue.cc File chrome/browser/chromeos/file_system_provider/queue.cc (right): https://codereview.chromium.org/829553002/diff/140001/chrome/browser/chromeos/file_system_provider/queue.cc#newcode63 chrome/browser/chromeos/file_system_provider/queue.cc:63: ...
5 years, 11 months ago (2015-01-08 08:37:51 UTC) #11
hirono
Thanks. lgtm with a nit! https://codereview.chromium.org/829553002/diff/180001/chrome/browser/chromeos/file_system_provider/provided_file_system_info.cc File chrome/browser/chromeos/file_system_provider/provided_file_system_info.cc (right): https://codereview.chromium.org/829553002/diff/180001/chrome/browser/chromeos/file_system_provider/provided_file_system_info.cc#newcode22 chrome/browser/chromeos/file_system_provider/provided_file_system_info.cc:22: DCHECK_LE(0, opened_files_limit); The check ...
5 years, 11 months ago (2015-01-08 08:57:58 UTC) #12
mtomasz
https://codereview.chromium.org/829553002/diff/180001/chrome/browser/chromeos/file_system_provider/provided_file_system_info.cc File chrome/browser/chromeos/file_system_provider/provided_file_system_info.cc (right): https://codereview.chromium.org/829553002/diff/180001/chrome/browser/chromeos/file_system_provider/provided_file_system_info.cc#newcode22 chrome/browser/chromeos/file_system_provider/provided_file_system_info.cc:22: DCHECK_LE(0, opened_files_limit); On 2015/01/08 08:57:58, hirono wrote: > The ...
5 years, 11 months ago (2015-01-08 09:01:00 UTC) #13
mtomasz
On 2015/01/08 09:01:00, mtomasz wrote: > https://codereview.chromium.org/829553002/diff/180001/chrome/browser/chromeos/file_system_provider/provided_file_system_info.cc > File chrome/browser/chromeos/file_system_provider/provided_file_system_info.cc > (right): > > https://codereview.chromium.org/829553002/diff/180001/chrome/browser/chromeos/file_system_provider/provided_file_system_info.cc#newcode22 ...
5 years, 11 months ago (2015-01-08 09:01:11 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/829553002/200001
5 years, 11 months ago (2015-01-08 09:01:30 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/12703)
5 years, 11 months ago (2015-01-08 09:33:23 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/829553002/240001
5 years, 11 months ago (2015-01-09 05:22:12 UTC) #20
commit-bot: I haz the power
Committed patchset #13 (id:240001)
5 years, 11 months ago (2015-01-09 06:18:55 UTC) #21
commit-bot: I haz the power
5 years, 11 months ago (2015-01-09 06:19:36 UTC) #22
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/3dd2edf4a117d03d2ec45bb3dcf205cb7561a7e1
Cr-Commit-Position: refs/heads/master@{#310717}

Powered by Google App Engine
This is Rietveld 408576698