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

Issue 213473007: Implement Read/WriteAtCurrentPos correctly (Closed)

Created:
6 years, 9 months ago by hashimoto
Modified:
6 years, 8 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org
Visibility:
Public.

Description

Implement Read/WriteAtCurrentPos correctly BUG=356979 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=260673

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -4 lines) Patch
M base/files/file_posix.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M base/platform_file_posix.cc View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
hashimoto
6 years, 9 months ago (2014-03-27 02:16:14 UTC) #1
rvargas (doing something else)
Looks good but you need an owner anyway so adding Mark.
6 years, 9 months ago (2014-03-27 17:41:31 UTC) #2
hashimoto
Mark is ooo. Nico, could you take a look at this change as an owner?
6 years, 8 months ago (2014-03-31 02:56:03 UTC) #3
Nico
lgtm Wow. Is it possible to test this?
6 years, 8 months ago (2014-03-31 04:10:37 UTC) #4
Nico
Sorry, meant to hit "publish drafts" but hit tab once too often and hit "quick ...
6 years, 8 months ago (2014-03-31 04:11:13 UTC) #5
hashimoto
On 2014/03/31 04:11:13, Nico wrote: > Sorry, meant to hit "publish drafts" but hit tab ...
6 years, 8 months ago (2014-03-31 04:20:04 UTC) #6
Nico
rvargas, can you help coming up with a test? (Why does the test have to ...
6 years, 8 months ago (2014-03-31 04:33:10 UTC) #7
hashimoto
On 2014/03/31 04:33:10, Nico wrote: > rvargas, can you help coming up with a test? ...
6 years, 8 months ago (2014-03-31 04:39:06 UTC) #8
rvargas (doing something else)
On 2014/03/31 04:39:06, hashimoto wrote: > On 2014/03/31 04:33:10, Nico wrote: > > rvargas, can ...
6 years, 8 months ago (2014-03-31 19:18:57 UTC) #9
Nico
On 2014/03/31 19:18:57, rvargas wrote: > On 2014/03/31 04:39:06, hashimoto wrote: > > On 2014/03/31 ...
6 years, 8 months ago (2014-03-31 19:27:37 UTC) #10
rvargas (doing something else)
On 2014/03/31 19:27:37, Nico wrote: > On 2014/03/31 19:18:57, rvargas wrote: > > On 2014/03/31 ...
6 years, 8 months ago (2014-03-31 19:47:42 UTC) #11
rvargas (doing something else)
The CQ bit was checked by rvargas@chromium.org
6 years, 8 months ago (2014-03-31 19:47:55 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hashimoto@chromium.org/213473007/1
6 years, 8 months ago (2014-03-31 19:48:48 UTC) #13
commit-bot: I haz the power
Change committed as 260673
6 years, 8 months ago (2014-03-31 22:18:12 UTC) #14
hashimoto
6 years, 8 months ago (2014-04-04 06:38:49 UTC) #15
Message was sent while issue was closed.
On 2014/03/31 19:47:42, rvargas wrote:
> On 2014/03/31 19:27:37, Nico wrote:
> > On 2014/03/31 19:18:57, rvargas wrote:
> > > On 2014/03/31 04:39:06, hashimoto wrote:
> > > > On 2014/03/31 04:33:10, Nico wrote:
> > > > > rvargas, can you help coming up with a test?
> > > > > 
> > > > > (Why does the test have to use threads at all? This looks like a fix
> > that's
> > > > > relevant in single-thread use too to my uniformed eyes.)
> > > > 
> > > > I'd use threads to implement the said test because I couldn't come up
with
> a
> > > way
> > > > to produce a situation where read() returns a smaller value than the
> buffer
> > > size
> > > > before reaching EOF.
> > > > If it can be done without real threads, I'd be happy to do that way.
> > > 
> > > Nico, could we land this as is while we come up with a test? We are
waiting
> > for
> > > a merge to M35.
> > 
> > Ok, lgtm
> > 
> > > As for the test, this function is meant to be used with things like files
on
> > > disk, which should always be able to read whatever was requested (as long
as
> > the
> > > file is large enough), as opposed to say, streams. The problem was of
course
> > > that signals can interrupt the operation before completion... but for that
> now
> > > we have the retry macro.
> > 
> > A pipe sounds like a good suggestion for a test.
> > 
> > > I _think_ the system can decide to return part of the data from disk if
> > there's
> > > a lot of disk activity and doing another read from disk will take time
> (maybe
> > a
> > > fragmented file?), but I'm mostly guessing. What I know is that we used to
> > have
> > > tests outside of base that required looping to avoid flakiness in loaded
> > > systems.
> > 
> > At least on posix, `man 2 read` says "The system guarantees to read the
number
> > of bytes requested if the descriptor references a normal file that has that
> many
> > bytes left before the end-of-file, but in no other case.".
> 
> Maybe we should remove the NoBestEffort versions then?
I'm a bit worried about this movement.
I could find the "The system guarantees..." sentence in the man page of BSD, but
could not in the one of Linux.
> 
> > 
> > > I don't think we want to write a test with something like a pipe (but we
> > could)
> > > because that is not the intended use case. On the other hand, that would
be
> > the
> > > simplest test... overloading the system just to see if it split reads in
> order
> > > to exercise this path seems less than ideal.

Powered by Google App Engine
This is Rietveld 408576698