Skip to content

Conversation

@DennisHeimbigner
Copy link
Collaborator

@DennisHeimbigner DennisHeimbigner commented Nov 4, 2025

Begin the consolidation of global state into two files: libdispatch/dglobal.c and include/ncglobal.h.

Primary Changes

  • New files: include/ncglobal.h and libdispatch/dglobal.c.
  • Refactor NCglobalstate decls from nc4internal.h to ncglobal.h.
  • Refactor NCglobalstate implementation from nc4internal.c and ddispatch.c to dglobal.c.
  • Replace/augment #include "nc4internal.h" with #include "ncglobal.h".
  • Refactor ChunkCache implementation from nc4internal.c to dglobal.c.
    • Side effect: clear chunkcache using memset.

Secondary Changes

  • Modify ncs3sdk.h to define new macros for a variety of AWS keys for environment variables, .aws/config profile keys, AWS-related .ncrc keys, and AWS URI fragment keys.
    • Side effect: replace old macros and in-line string constants with the new macros. Changes primarily in libdispatch/ds3util.c and libdispatch/ncs3sdk_h5.c.
  • Fix a problem in some tests in nczarr_test: modify cp, unzip and gunzip to remove target before overwriting.
  • Fix minor bug in libdap4/d4meta.c
  • Fix minor bug in plugins/H5Zshuffle.c.
  • Modify nclog to ensure that error log messages always get printed irrespective of the logging state.

DennisHeimbigner and others added 30 commits September 20, 2025 13:42
Provide macro constants for all sources for AWS key values.
The possible sources and prefix names are as follows:

| Source             | Macro Prefix |
|--------------------|--------------|
| getenv() Variables | AWS_ENV_XXX |
| .rc file keys      | AWS_RC_XXX  |
| .aws profiles      | AWS_PROF_XXX|
| URL fragment keys  | AWS_FRAG_XXX|

* The macros are in include/ncs3sdk.h.
* Some previous macros in other files have been removed.
Provide macro constants for all sources for AWS key values.
The possible sources and prefix names are as follows:

| Source             | Macro Prefix |
|--------------------|--------------|
| getenv() Variables | AWS_ENV_XXX |
| .rc file keys      | AWS_RC_XXX  |
| .aws profiles      | AWS_PROF_XXX|
| URL fragment keys  | AWS_FRAG_XXX|

* The macros are in include/ncs3sdk.h.
* Some previous macros in other files have been removed.
Begin the consolidation of global state into two files: libdispatch/dglobal.c and include/ncglobal.h.

## Primary Changes
* New files: include/ncglobal.h and libdispatch/dglobal.c.
* Refactor NCglobalstate decls from nc4internal.h to ncglobal.h.
* Refactor NCglobalstate implementation from nc4internal.c and ddispatch.c to dglobal.c.
* Replace/augment ``#include "nc4internal.h"`` with ``#include "ncglobal.h"``.
* Refactor ChunkCache implementation from nc4internal.c to dglobal.c.
    * Side effect: clear chunkcache using memset.

## Secondary Changes
* Modify ncs3sdk.h to define new macros for a variety of AWS keys for environment variables, .aws/config profile keys, AWS-related .ncrc keys, and AWS URI fragment keys.
    * Side effect: replace old macros and in-line string constants with the new macros. Changes primarily in libdispatch/ds3util.c and libdispatch/ncs3sdk_h5.c.
* Fix a  problem in some tests in nczarr_test: modify cp, unzip and gunzip to remove target before overwriting.
* Fix minor bug in libdap4/d4meta.c
* Fix minor bug in plugins/H5Zshuffle.c.
* Modify nclog to ensure that error log messages always get printed irrespective of the logging state.
@DennisHeimbigner DennisHeimbigner changed the title S3global.dmh Initial consolidation of global state Nov 5, 2025
@DennisHeimbigner DennisHeimbigner marked this pull request as draft November 10, 2025 03:55
@DennisHeimbigner DennisHeimbigner marked this pull request as ready for review December 4, 2025 20:58
Copy link
Member

@WardF WardF left a comment

Choose a reason for hiding this comment

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

Dennis, is this PR still good to be merged? I'm working my way up, and still need to review the PR (and comments) from DRKZ.

@DennisHeimbigner
Copy link
Collaborator Author

Yes, it can be merged, but since we are so close to getting mannreis zmetadata prs merged I would probably
hold off on it and concentrate on his prs.

@DennisHeimbigner
Copy link
Collaborator Author

Ok, I updated this PR to include the zmetadata-containing PR. So it should ready to go at your leisure.

@WardF WardF self-assigned this Dec 22, 2025
@WardF WardF merged commit 505658e into Unidata:main Dec 22, 2025
103 checks passed
@DennisHeimbigner DennisHeimbigner deleted the s3global.dmh branch January 5, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants