You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an attempt to properly resolve a JRuby specific issue: #37
which concerns traditional (Java) deployments, where source of them gem and thus this gem's DB files end up in a zip archive (.jar or .war).
While the issue is JRuby specific, it's unlikely an approach of fixing seek+pread for such scenarios would be the optimal path, seems much better to just fallback to read-ing the files in-memory.
I have implemented an alternative fix for future versions of JRuby that will fully read jar resources into a separate buffer and make that buffer available as a seekable IO. It's basically the same as this PR but done internally in JRuby directly against an eagerly-read buffer.
My criteria for fully reading is that it must be a jar:file URL, indicating that it is a resource from a local jar file and likely ok to fully read into memory (loading the jar and accessing the resource will do some amount of this anyway). It does mean the contents of the resource may be doubled-up in memory (compressed in the loaded jar, uncompressed in the eager buffer) but I think that's an acceptable trade-off to make files embedded in a jar appear to be more "normal".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an attempt to properly resolve a JRuby specific issue: #37
which concerns traditional (Java) deployments, where source of them gem and thus this gem's DB files end up in a zip archive (.jar or .war).
While the issue is JRuby specific, it's unlikely an approach of fixing
seek+preadfor such scenarios would be the optimal path, seems much better to just fallback to read-ing the files in-memory.