From 1ed7058fc8a117fe5aadbd6336064fc7f3230670 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 1 Aug 2023 08:41:19 -0500 Subject: [PATCH 1/4] Fix loading plugin fails with missing directory GH issue #3248 --- release_docs/RELEASE.txt | 9 ++++++++- src/H5PLpath.c | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 614380e56ef..7734974d85e 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -169,9 +169,16 @@ New Features Library: -------- + - Change the error handling for a not found path in the find plugin process. + + While attempting to load a plugin the HDF5 library will fail if one of the + directories in the plugin paths does not exist, even if there are more paths + to check. Instead of exiting the function with an error, just logged the error + and continue processing the list of paths to check. + - Implemented support for temporary security credentials for the Read-Only S3 (ROS3) file driver. - + When using temporary security credentials, one also needs to specify a session/security token next to the access key id and secret access key. This token can be specified by the new API function H5Pset_fapl_ros3_token(). diff --git a/src/H5PLpath.c b/src/H5PLpath.c index c47c6faf792..2c0063dc557 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -801,7 +801,7 @@ H5PL__find_plugin_in_path_table(const H5PL_search_params_t *search_params, hbool /* Search for the plugin in this path */ if (H5PL__find_plugin_in_path(search_params, found, H5PL_paths_g[u], plugin_info) < 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in path %s encountered an error", + HDONE_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in path %s encountered an error", H5PL_paths_g[u]) /* Break out if found */ From c0f053a913e65252fe5ffbbf577e9a719a128520 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 1 Aug 2023 09:06:08 -0500 Subject: [PATCH 2/4] Add missing semicolon --- src/H5PLpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5PLpath.c b/src/H5PLpath.c index 2c0063dc557..61d9d953c2b 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -802,7 +802,7 @@ H5PL__find_plugin_in_path_table(const H5PL_search_params_t *search_params, hbool /* Search for the plugin in this path */ if (H5PL__find_plugin_in_path(search_params, found, H5PL_paths_g[u], plugin_info) < 0) HDONE_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in path %s encountered an error", - H5PL_paths_g[u]) + H5PL_paths_g[u]); /* Break out if found */ if (*found) { From 86ba3ff92cbd45a5037950cc117c06e2f5e5904f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 1 Aug 2023 09:52:21 -0500 Subject: [PATCH 3/4] Add test and fix error log --- src/H5PLpath.c | 2 +- test/filter_plugin.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/H5PLpath.c b/src/H5PLpath.c index 61d9d953c2b..0c37f115e78 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -801,7 +801,7 @@ H5PL__find_plugin_in_path_table(const H5PL_search_params_t *search_params, hbool /* Search for the plugin in this path */ if (H5PL__find_plugin_in_path(search_params, found, H5PL_paths_g[u], plugin_info) < 0) - HDONE_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in path %s encountered an error", + HERROR(H5E_PLUGIN, H5E_CANTGET, "search in path %s encountered an error", H5PL_paths_g[u]); /* Break out if found */ diff --git a/test/filter_plugin.c b/test/filter_plugin.c index 64230e549af..6bd63d561b7 100644 --- a/test/filter_plugin.c +++ b/test/filter_plugin.c @@ -1524,6 +1524,12 @@ main(void) else my_fapl_id = old_ff_fapl_id; + /* Add extra path to check for correct error process */ + if (H5PLprepend("bogus") < 0) { + fprintf(stderr, "Could not prepend path:bogus\n"); + TEST_ERROR; + } + /* Reopen the file for testing data reading */ if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, my_fapl_id)) < 0) TEST_ERROR; From 5663158ebc757b341a8845e5840b0a6f90e6b543 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 1 Aug 2023 14:54:37 +0000 Subject: [PATCH 4/4] Committing clang-format changes --- src/H5PLpath.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/H5PLpath.c b/src/H5PLpath.c index 0c37f115e78..5681c1ff69f 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -801,8 +801,7 @@ H5PL__find_plugin_in_path_table(const H5PL_search_params_t *search_params, hbool /* Search for the plugin in this path */ if (H5PL__find_plugin_in_path(search_params, found, H5PL_paths_g[u], plugin_info) < 0) - HERROR(H5E_PLUGIN, H5E_CANTGET, "search in path %s encountered an error", - H5PL_paths_g[u]); + HERROR(H5E_PLUGIN, H5E_CANTGET, "search in path %s encountered an error", H5PL_paths_g[u]); /* Break out if found */ if (*found) {