mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-02 12:32:04 +00:00
Fix error
This commit is contained in:
parent
fd5c1561e2
commit
46723a2c3c
@ -71,6 +71,9 @@ AsynchronousReadBufferFromFile::AsynchronousReadBufferFromFile(
|
|||||||
|
|
||||||
AsynchronousReadBufferFromFile::~AsynchronousReadBufferFromFile()
|
AsynchronousReadBufferFromFile::~AsynchronousReadBufferFromFile()
|
||||||
{
|
{
|
||||||
|
/// Must wait for events in flight before closing the file.
|
||||||
|
finalize();
|
||||||
|
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -89,5 +92,13 @@ void AsynchronousReadBufferFromFile::close()
|
|||||||
fd = -1;
|
fd = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
AsynchronousReadBufferFromFileWithCache::~AsynchronousReadBufferFromFileWithCache()
|
||||||
|
{
|
||||||
|
/// Must wait for events in flight before potentially closing the file by destroying OpenedFilePtr.
|
||||||
|
finalize();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +58,8 @@ public:
|
|||||||
fd = file->getFD();
|
fd = file->getFD();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
~AsynchronousReadBufferFromFileWithCache() override;
|
||||||
|
|
||||||
std::string getFileName() const override
|
std::string getFileName() const override
|
||||||
{
|
{
|
||||||
return file_name;
|
return file_name;
|
||||||
|
@ -62,7 +62,7 @@ bool AsynchronousReadBufferFromFileDescriptor::nextImpl()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AsynchronousReadBufferFromFileDescriptor::~AsynchronousReadBufferFromFileDescriptor()
|
void AsynchronousReadBufferFromFileDescriptor::finalize()
|
||||||
{
|
{
|
||||||
if (prefetch_request_id)
|
if (prefetch_request_id)
|
||||||
{
|
{
|
||||||
@ -72,6 +72,12 @@ AsynchronousReadBufferFromFileDescriptor::~AsynchronousReadBufferFromFileDescrip
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
AsynchronousReadBufferFromFileDescriptor::~AsynchronousReadBufferFromFileDescriptor()
|
||||||
|
{
|
||||||
|
finalize();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// If 'offset' is small enough to stay in buffer after seek, then true seek in file does not happen.
|
/// If 'offset' is small enough to stay in buffer after seek, then true seek in file does not happen.
|
||||||
off_t AsynchronousReadBufferFromFileDescriptor::seek(off_t offset, int whence)
|
off_t AsynchronousReadBufferFromFileDescriptor::seek(off_t offset, int whence)
|
||||||
{
|
{
|
||||||
|
@ -30,6 +30,8 @@ protected:
|
|||||||
/// Name or some description of file.
|
/// Name or some description of file.
|
||||||
std::string getFileName() const override;
|
std::string getFileName() const override;
|
||||||
|
|
||||||
|
void finalize();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AsynchronousReadBufferFromFileDescriptor(
|
AsynchronousReadBufferFromFileDescriptor(
|
||||||
AsynchronousReaderPtr reader_,
|
AsynchronousReaderPtr reader_,
|
||||||
|
Loading…
Reference in New Issue
Block a user