Skip to content

Commit

Permalink
[1112] fix test failures due to open file handles
Browse files Browse the repository at this point in the history
  • Loading branch information
anuchak committed Jan 6, 2023
1 parent e2782be commit e7bc095
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/include/storage/buffer_manager/file_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ class FileHandle {

FileHandle(const string& path, uint8_t flags);

~FileHandle();

// This function is intended to be used after a fileInfo is created and we want the file
// to have not pages and page locks. Should be called after ensuring that the buffer manager
// does not hold any of the pages of the file.
Expand Down
2 changes: 2 additions & 0 deletions src/include/storage/storage_structure/disk_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ class BaseDiskArray {
BaseDiskArray(
FileHandle& fileHandle, page_idx_t headerPageIdx, BufferManager* bufferManager, WAL* wal);

virtual ~BaseDiskArray() = default;

uint64_t getNumElements(TransactionType trxType = TransactionType::READ_ONLY);

U get(uint64_t idx, TransactionType trxType);
Expand Down
6 changes: 0 additions & 6 deletions src/storage/buffer_manager/file_handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ FileHandle::FileHandle(const string& path, uint8_t flags)
}
}

FileHandle::~FileHandle() {
if (fileInfo != nullptr && fileInfo->fd != -1) {
close(fileInfo->fd);
}
}

void FileHandle::constructExistingFileHandle(const string& path) {
int openFlags = O_RDWR | ((createFileIfNotExists()) ? O_CREAT : 0x00000000);
fileInfo = FileUtils::openFile(path, openFlags);
Expand Down
1 change: 0 additions & 1 deletion src/storage/storage_structure/lists/lists_metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,5 @@ void ListsMetadataBuilder::populatePageIdsInAPageList(uint32_t numPages, uint32_
pageListHeadIdx++;
}
}

} // namespace storage
} // namespace kuzu

0 comments on commit e7bc095

Please sign in to comment.