Re: data written to file missed by reader
- From: "David Schwartz" <davids@xxxxxxxxxxxxx>
- Date: 13 Sep 2006 12:32:27 -0700
seanmkirkpatrick@xxxxxxxxx wrote:
We currently run processes that communicate by writing an encoded
message to a flat file while other processes are reading the file. A
message that was written to the file by one process (fsync is not
called after each write) was missed by the reader. A second message
was written 1 ms later. When I say "missed", I mean that the process
read the second message and continued processing. Another process
reading messages from the same file came through ~200 ms later and read
the missed message and then the second message in the expected
sequence. Is there some kind of synchronization issue after the data
has been written that could have caused the reading process to miss the
data? Perhaps during the flush to disk? Is there any inter-process
file access management performed in the virtual layer?
How do readers detect that there is new data in the file? Do they check
for a change in the modification time and then re-read the file? Or is
new data appended to the file and they periodically try to read past
what was previously the end of the file?
My bet is that there is a flaw in your scheme for detecting new
messages. But it's hard to say without knowing in much more detail how
your scheme actually works.
DS
.
- References:
- data written to file missed by reader
- From: seanmkirkpatrick
- data written to file missed by reader
- Prev by Date: data written to file missed by reader
- Next by Date: Re: Overriding System Calls
- Previous by thread: data written to file missed by reader
- Next by thread: Re: data written to file missed by reader
- Index(es):
Relevant Pages
|