Blocking Call on DigestAlgorithm

Open
#6,590 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
backend

Research direction

Start in core/checksums/src/main/java/software/amazon/awssdk/checksums/internal/DigestAlgorithm.java around line 55, focusing on the LinkedBlockingDeque introduced by commit c137348d. Reproduce the behavior with an async DynamoDB GetItem request under BlockHound. Done means the async SDK request no longer triggers a blocking-call report in DigestAlgorithm.

Written by the indexing model from the issue text.

Description

bug p2
Describe the bug

Hello,

While using BlockHound to detect blocking calls on our service, we found out a blocking call on https://github.com/aws/aws-sdk-java-v2/blob/master/core/checksums/src/main/java/software/amazon/awssdk/checksums/internal/DigestAlgorithm.java#L55 . It seems this is related to a recent change in this class (https://github.com/aws/aws-sdk-java-v2/commit/c137348d67e7cfa2d5f3dcd81e187facfed3e2d8) that introduced a LinkedBlockingDeque.

Regression Issue
  • Select this option if this issue appears to be a regression.
Expected Behavior

The Async version of the SDK shouldn't block threads.

Current Behavior

Due to the internal code of LinkedBlockingDeque, the modified DigestAlgorithm blocks.

Reproduction Steps

Any HTTP request will trigger this issue, example the Async SDK for DynamoDB (GetItem).

Possible Solution

Use ConcurrentLinkedDeque or ThreadLocal perhaps.

Additional Information/Context

No response

AWS Java SDK version used

2.33.11

JDK version used

21

Operating System and version

Mac

Dominant language
Java
Stars
2.6k
Forks
1k
Avg merge
2d 17h
Merged PRs (30d)
39

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aws/aws-sdk-java-v2

All issues in aws/aws-sdk-java-v2

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.