Files
scylladb/core
Vlad Zolotarov c547f9a718 fstream: prevent ANY exceptions to be thrown in good get() flow
There is a hidden exception that could be thrown insize file::dma_get_bulk()
if file size is not aligned with fstream::_buffer_size. In this case
file::dma_read_bulk() will be given a _buffer_size as a length for the last data
chunk in the file too. file::dma_read_bulk() will get a short read (till EOF)
and then will try to read beyond it (by calling file::read_maybe_eof())
in order to differentiate between I/O error and EOF. file::read_maybe_eof()
will throw a file::eof_error exception to indicate the EOF, it will be caught
by file::dma_read_bulk() and since we have read some "good" bytes by now this
exception won't be forwarded further. However the damage by throwing the exception
has already been done and we want to avoid this in fstream flow (unless there are
real errors).

In order to prevent the above we will always request file::dma_read_bulk() to
read the amount of data it should be able to deliver (not beyond EOF).

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-05-28 13:25:40 +03:00
..
2015-03-01 15:29:13 +02:00
2015-04-02 10:27:38 +03:00
2015-04-19 10:33:38 +03:00
2015-03-11 14:45:43 +02:00
2015-05-19 19:33:18 +03:00
2015-03-15 20:18:17 +02:00
2015-05-19 19:33:18 +03:00
2015-03-03 14:58:58 +02:00
2015-05-11 13:33:33 +03:00
2015-03-24 10:12:47 +02:00
2015-05-14 11:26:58 +03:00