-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(wasm): clean up download, byte handling and hashing #379
Conversation
fixed logs leaking, we should look into a log framework, where debug level logs can be used and then those paths are not valid in production. |
another failure mode is cache permission, this would be more ideal: let mut path = std::env::var("PGDATA")
.map(PathBuf::from)
.map_err(|_| "PGDATA environment variable not set")?
.join("extension_cache")
.join("wasm_fdw"); Three issues I see with the current approach:
|
Thanks for the PR! All the improvements look good to me but I am not much in favour of using
So the cache dir is still owned by Postgres, and normally it is not writable by other users. |
understood, thanks! |
I'll hold back on the patch for cache path, but all the commits here I believe are good to go. Let me know if you need anything else. |
@akacase I've made some minor changes on top of your patch, please have a look at your repo and review it. If everything is fine, we will be ready to merge. Thanks. |
chore: improve code to make it consistent and clippy happy
merged, thanks! |
What kind of change does this PR introduce?
#378
What is the current behavior?
#378
What is the new behavior?
The wasmtime errors were probably because:
These issues might not have appeared until recently because:
The new code is more defensive about:
Additional context
I have added bytes here for a specific reason:
The
bytes
crate is specifically designed for working with raw binary dataIt ensures we don't accidentally corrupt binary data through string conversions or character encoding issues. This is crucial for WASM files, which must maintain exact byte-level integrity. Bytes itself is highly efficient (zero-copy).
Thanks!