Terracotta-OSS / offheap-store

A library that provides a set of map and cache implementations that store data outside of the normal Java heap
Apache License 2.0
90 stars 46 forks source link

FileBackedStorageEngine doesn't handle interaction of interrupted threads with it's write-side FileChannel #72

Closed chrisdennis closed 3 years ago

chrisdennis commented 3 years ago

The vast majority of file writes done on FileBackedStorageEngine are performed through it's worker threads via asycn disk-write tasks. This means they are essentially immune to the effects of asynchronous channel closure caused by interrupting the writer threads. We do however do synchronous writes from user threads using the disk write context for updating entry metadata. To handle this properly we need to use the same tactics used for the read channel side on the write side.

chrisdennis commented 3 years ago

Fixed by #73