Skip to content

Commit

Permalink
Merge pull request #358 from metaskills/ReadOnlyFilesystem
Browse files Browse the repository at this point in the history
Ignore Read-Only Filesystems
  • Loading branch information
casperisfine committed Apr 27, 2021
2 parents a7b3628 + 4ccccfc commit 2d40bd3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/bootsnap/load_path_cache/store.rb
Expand Up @@ -91,6 +91,7 @@ def dump_data
FileUtils.mv(tmp, @store_path)
rescue Errno::EEXIST
retry
rescue SystemCallError
end
end
end
Expand Down
6 changes: 6 additions & 0 deletions test/load_path_cache/store_test.rb
Expand Up @@ -74,6 +74,12 @@ def test_retry_on_collision

store.transaction { store.set('a', 1) }
end

def test_ignore_read_only_filesystem
MessagePack.expects(:dump).raises(Errno::EROFS.new("Read-only file system @ rb_sysopen"))
store.transaction { store.set('a', 1) }
refute(File.exist?(@path))
end
end
end
end

0 comments on commit 2d40bd3

Please sign in to comment.