Skip to content
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

Increased H5FD_ROS3_MAX_SECRET_TOK_LEN to 4096 to accommodate long AWS secret tokens #4064

Merged
merged 3 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 26 additions & 24 deletions src/H5FDros3.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@

#ifdef H5_HAVE_ROS3_VFD

/* toggle function call prints: 1 turns on
/* toggle debugging; pick a level
*/
#define ROS3_DEBUG 0
#define ROS3_DEBUG_NONE 0
#define ROS3_DEBUG_TRACE_API 1
#define ROS3_DEBUG_TRACE_INTERNAL 2
#define ROS3_DEBUG ROS3_DEBUG_NONE

/* toggle stats collection and reporting
*/
Expand Down Expand Up @@ -315,18 +318,18 @@ H5FD_ros3_init(void)
if (H5I_INVALID_HID == H5FD_ROS3_g) {
HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register ros3");
}
}

#if ROS3_STATS
/* pre-compute statsbin boundaries
*/
for (bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) {
unsigned long long value = 0;
/* pre-compute statsbin boundaries */
/* do it only during initial registration */
for (bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) {
unsigned long long value = 0;

ROS3_STATS_POW(bin_i, &value)
ros3_stats_boundaries[bin_i] = value;
}
ROS3_STATS_POW(bin_i, &value)
ros3_stats_boundaries[bin_i] = value;
}
#endif
}

ret_value = H5FD_ROS3_g;

Expand Down Expand Up @@ -858,7 +861,7 @@ ros3_reset_stats(H5FD_ros3_t *file)

FUNC_ENTER_PACKAGE

#if ROS3_DEBUG
#if ROS3_DEBUG >= ROS3_DEBUG_TRACE_INTERNAL
printf("ros3_reset_stats() called\n");
#endif

Expand Down Expand Up @@ -1169,8 +1172,7 @@ ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file)
* PRINT OVERVIEW *
******************/

fprintf(stream, "TOTAL READS: %llu (%llu meta, %llu raw)\n", count_raw + count_meta, count_meta,
count_raw);
fprintf(stream, "TOTAL READS: %lu (%lu meta, %lu raw)\n", count_raw + count_meta, count_meta, count_raw);
fprintf(stream, "TOTAL BYTES: %llu (%llu meta, %llu raw)\n", bytes_raw + bytes_meta, bytes_meta,
bytes_raw);

Expand Down Expand Up @@ -1294,7 +1296,7 @@ ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file)
re_dub /= 1024.0;
assert(suffix_i < sizeof(suffixes));

fprintf(stream, " %8.3f%c %7d %7d %8.3f%c %8.3f%c %8.3f%c %8.3f%c\n", re_dub,
fprintf(stream, " %8.3f%c %7llu %7llu %8.3f%c %8.3f%c %8.3f%c %8.3f%c\n", re_dub,
suffixes[suffix_i], /* bin ceiling */
m->count, /* metadata reads */
r->count, /* raw data reads */
Expand Down Expand Up @@ -1342,17 +1344,17 @@ H5FD__ros3_close(H5FD_t H5_ATTR_UNUSED *_file)
assert(file != NULL);
assert(file->s3r_handle != NULL);

/* Close the underlying request handle
*/
if (FAIL == H5FD_s3comms_s3r_close(file->s3r_handle))
HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close S3 request handle");

#if ROS3_STATS
/* TODO: mechanism to re-target stats printout */
if (ros3_fprint_stats(stdout, file) == FAIL)
HGOTO_ERROR(H5E_INTERNAL, H5E_ERROR, FAIL, "problem while writing file statistics");
#endif /* ROS3_STATS */

/* Close the underlying request handle
*/
if (FAIL == H5FD_s3comms_s3r_close(file->s3r_handle))
HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close S3 request handle");

/* Release the file info */
H5MM_xfree(file->cache);
file = H5FL_FREE(H5FD_ros3_t, file);
Expand Down Expand Up @@ -1381,7 +1383,7 @@ H5FD__ros3_close(H5FD_t H5_ATTR_UNUSED *_file)
* + fapl secret_id
* + fapl secret_key
*
* tl;dr -> check URL, check crentials
* tl;dr -> check URL, check credentials
*
* Return:
*
Expand Down Expand Up @@ -1510,7 +1512,7 @@ H5FD__ros3_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags)
{
FUNC_ENTER_PACKAGE_NOERR

#if ROS3_DEBUG
#if ROS3_DEBUG >= ROS3_DEBUG_TRACE_INTERNAL
fprintf(stdout, "H5FD__ros3_query() called.\n");
#endif

Expand Down Expand Up @@ -1547,7 +1549,7 @@ H5FD__ros3_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)

FUNC_ENTER_PACKAGE_NOERR

#if ROS3_DEBUG
#if ROS3_DEBUG >= ROS3_DEBUG_TRACE_INTERNAL
fprintf(stdout, "H5FD__ros3_get_eoa() called.\n");
#endif

Expand Down Expand Up @@ -1575,7 +1577,7 @@ H5FD__ros3_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)

FUNC_ENTER_PACKAGE_NOERR

#if ROS3_DEBUG
#if ROS3_DEBUG >= ROS3_DEBUG_TRACE_INTERNAL
fprintf(stdout, "H5FD__ros3_set_eoa() called.\n");
#endif

Expand Down Expand Up @@ -1606,7 +1608,7 @@ H5FD__ros3_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)

FUNC_ENTER_PACKAGE_NOERR

#if ROS3_DEBUG
#if ROS3_DEBUG >= ROS3_DEBUG_TRACE_INTERNAL
fprintf(stdout, "H5FD__ros3_get_eof() called.\n");
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/H5FDros3.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
* \def H5FD_ROS3_MAX_SECRET_TOK_LEN
* Maximum string length for specifying the session/security token.
*/
#define H5FD_ROS3_MAX_SECRET_TOK_LEN 1024
#define H5FD_ROS3_MAX_SECRET_TOK_LEN 4096

/**
*\struct H5FD_ros3_fapl_t
Expand Down
Loading
Loading