mirror of https://github.com/sbt/sbt.git
Windows io really doesn't handle concurrent readers and writers all that well. Using the LegacyFileTreeRepository was problematic in windows scripted tests because even though the repository implementation did not use the cache in its list methods, it did persistently monitor the directories that were registered. The monitor has to do a lot of io on a background thread to maintain the cache. This caused io contention that would cause IO.createDirectory to fail with an obscure AccessDeniedException. The way to avoid this is to prevent the background io from occurring at all. I don't necessarily think this will impact most users running sbt interactively with a cache, but it did cause scripted tests to fail. For that reason I made the default in non-interactive/shell use cases on windows to be a PollingFileRepository which never monitors the file system except when we are in a watch. The LegacyFileTreeRepository works fine on mac and linux which have a more forgiving file system. To make this work, I had to add FileManagement.toMonitoringRepository. There are now two kinds of repositories that cannot monitor on their own: HybridPollingFileTreeRepository and PollingFileRepository. The FileManagement.toMonitoringRepository makes a new repository that turns on monitoring for those two repository types and disables the close method on all other repositories so that closing the FileEventMonitor does not actually close the global file repository. |
||
|---|---|---|
| .. | ||
| src | ||
| NOTICE | ||