Skip to content

Commit

Permalink
Fix H5Zzstd error reporting and decompressed size behavior (#1151)
Browse files Browse the repository at this point in the history
* Fix H5Zzstd error reporting and decompressed size behavior

* Remove commented out code

* Use async so that callback function returns properly

* Fix formatting
  • Loading branch information
mkitti authored Jun 2, 2024
1 parent eaf6641 commit 34bf471
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions filters/H5Zzstd/src/H5Zzstd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ function H5Z_filter_zstd(
#decompresssion

decompSize = LibZstd.ZSTD_getDecompressedSize(inbuf, origSize)
if decompSize == 0
error("zstd_h5plugin: Cannot retrieve decompressed chunk size")
end
outbuf = Libc.malloc(decompSize)
if outbuf == C_NULL
error(
Expand Down Expand Up @@ -83,11 +86,11 @@ function H5Z_filter_zstd(
catch e
# "In the case of failure, the return value is 0 (zero) and all pointer arguments are left unchanged."
ret_value = Csize_t(0)
@error "H5Zzstd Non-Fatal ERROR: " err
display(stacktrace(catch_backtrace()))
# Output Julia error via async so we do not task switch during callback
@async @error "H5Zzstd Non-Fatal ERROR: " exception = (e, catch_backtrace())
finally
if outbuf != C_NULL
free(outbuf)
Libc.free(outbuf)
end
end # try catch finally
return Csize_t(ret_value)
Expand Down

2 comments on commit 34bf471

@mkitti
Copy link
Member Author

@mkitti mkitti commented on 34bf471 Jun 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register subdir=filters/H5Zzstd

Release notes:

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/109582

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a H5Zzstd-v0.1.2 -m "<description of version>" 34bf471183ed3e0490799abbb9bc22306301e2f0
git push origin H5Zzstd-v0.1.2

Please sign in to comment.