neo4j/neo4j — pull request #3294 by chrisvest (2014-10-15 14:54:03+00:00)
Title: [2.2] Make the page cache cope well with AsynchronousCloseExceptions

It was possible for a stray interrupt to hit the page cache while in the middle
of a page fault. Such interrupts can cause the victim FileChannel to be closed,
leaving the page cache with a closed StoreChannel without its consent. This can
then cause further complications later on, because PagedFiles are flushed
before they are closed, and so the flushing can throw a ClosedChannelException
and in the end prevent the page cache from being able to shut down.

We now handle this much better, by making sure that the PageSwappers reopen
their StoreChannels whenever one the swapIn or swapOut methods throws a
ClosedChannelException. That is, unless the PageSwapper has been explicitly
closed.