Skip to content

HDDS-17959. reuse threadlocal sha-256 in stringtosignproducer.hash - #12210

Open
iprithv wants to merge 2 commits into
apache:masterfrom
iprithv:fix-stringtosign-threadlocal-sha256
Open

iprithv wants to merge 2 commits into
apache:masterfrom
iprithv:fix-stringtosign-threadlocal-sha256

Conversation

@iprithv

@iprithv iprithv commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Reuse a ThreadLocal SHA-256 digest in StringToSignProducer.hash instead of creating a new one on every SigV4 request. Also dropped the extra .toLowerCase() after kerby Hex.encode.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-17959

How was this patch tested?

https://github.com/iprithv/ozone/actions/runs/46582969899

Signed-off-by: prithvi <prithvisivasankar@gmail.com>
@github-actions github-actions Bot added the s3 S3 Gateway label Nov 30, 2026

@Test
public void testHash() throws Exception {
String first = StringToSignProducer.hash("abc");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

test should spawn 3 threads and do sha calculation inside spawned threads.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done, testHash now runs the hash checks on 3 threads. thanks!

Signed-off-by: prithvi <prithvisivasankar@gmail.com>
@iprithv
iprithv requested a review from yandrey321 December 1, 2026 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

s3 S3 Gateway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants