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

Change in Behavior of Client Interrupts Between V1 and V2 #5979

Open
1 task
belugabehr opened this issue Mar 21, 2025 · 3 comments
Open
1 task

Change in Behavior of Client Interrupts Between V1 and V2 #5979

belugabehr opened this issue Mar 21, 2025 · 3 comments
Labels
bug This issue is a bug. documentation This is a problem with documentation. p2 This is a standard priority issue

Comments

@belugabehr
Copy link
Contributor

belugabehr commented Mar 21, 2025

Describe the bug

In AWS JDK V2, when a client is interrupted, it does not clears the Interrupted Flag. However, there is a comment stating that it does.

/**
* Aborts with subclass specific abortion logic executed if needed.
* Note the interrupted status of the thread is cleared by this method.
*
* @throws AbortedException if found necessary.
*/
protected final void abortIfNeeded() {
if (Thread.currentThread().isInterrupted()) {
abort(); // execute subclass specific abortion logic
throw AbortedException.builder().build();
}
}

In AWS JDK V1, there interrupted status is indeed cleared.

Please ensure that V2 maintains the same behavior and clear the flag. This will help migrations from V1 to V2.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

The Interrupt flag should be cleared.

Current Behavior

The Interrupt flag is not cleared.

Reproduction Steps

Provided code samples in description.

Possible Solution

Provided suggesting in description.

Additional Information/Context

No response

AWS Java SDK version used

2

JDK version used

17

Operating System and version

Linux

@belugabehr belugabehr added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 21, 2025
@bhoradc
Copy link

bhoradc commented Mar 21, 2025

Hi @belugabehr,

Thanks for reporting the issue. We will look into this to address it soon.

Regards,
Chaitanya

@bhoradc bhoradc added p1 This is a high priority issue needs-review This issue or PR needs review from the team. and removed needs-triage This issue or PR still needs to be triaged. labels Mar 21, 2025
@bhoradc
Copy link

bhoradc commented Mar 24, 2025

Hi @belugabehr,

Modifying the Java SDK V2 behavior to match V1 regarding clearing the interrupt flag could potentially cause compatibility issues for existing V2 users who are already relying on or expecting the current behavior, where the interrupt flag is not cleared.

To avoid breaking existing V2 applications by changing the interrupt flag handling, we have decided to maintain the existing behavior in V2 and update the documentation to accurately reflect it, rather than introducing a change that could disrupt applications that rely on the current behavior.

Thanks again for reporting the discrepancy.

Regards,
Chaitanya

@bhoradc bhoradc added documentation This is a problem with documentation. p2 This is a standard priority issue and removed needs-review This issue or PR needs review from the team. p1 This is a high priority issue labels Mar 24, 2025
@belugabehr
Copy link
Contributor Author

Is there a way to set some sort of global compatibility flag (e.g., ENV Variable) to allow existing V1 users the ability to preserve this behavior? This is going to be a subtle change that no one will anticipate moving from V1 to V2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. documentation This is a problem with documentation. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

2 participants