Skip to content

Commit 99f612d

Browse files
TheAssembler1github-actions[bot]jeanbez
authored
Obj open fix (#279)
* Fix seg fault for PDCobj_open on non-existent object * Committing clang-format changes * Remove log from NULL check * Log message when object metadata isn't found. --------- Co-authored-by: github-actions <github-actions[bot]@users.noreply.github.com> Co-authored-by: Jean Luca Bez <jlbez@lbl.gov>
1 parent 7a42e85 commit 99f612d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/api/pdc_client_connect.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2422,8 +2422,17 @@ PDC_Client_query_metadata_name_timestep(const char *obj_name, int time_step, pdc
24222422
hg_atomic_set32(&atomic_work_todo_g, 1);
24232423
PDC_Client_check_response(&send_context_g);
24242424
*out = lookup_args.data;
2425-
LOG_DEBUG("rank = %d, PDC_Client_query_metadata_name_timestep = %u\n", pdc_client_mpi_rank_g,
2426-
out[0]->data_server_id);
2425+
2426+
/**
2427+
* Not necessarily an error. If the obj does not exist
2428+
* then this will be NULL. Still need to return as FAIL
2429+
* otherwise calling code will expect *out to be non-NULL.
2430+
*/
2431+
if (*out == NULL) {
2432+
LOG_INFO("Object metadata does not exist\n");
2433+
PGOTO_DONE(FAIL);
2434+
}
2435+
24272436
done:
24282437
HG_Destroy(metadata_query_handle);
24292438

0 commit comments

Comments
 (0)