aws / aws/aws-sdk-java-v2

SdkFilterInputStream.close should not abort

Offen
#6,906 2 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @debora-ito Auf GitHub ansehen
bug p2
Vorherrschende Sprache
Java
Sterne
2.6k
Forks
1k
Ø Merge
2 T. 9 Std.
Gemergte PRs (30 T.)
51

Beschreibung

### Describe the bug

`SdkFilterInputStream.close`, like all other overrides in `SdkFilterInputStream`, calls `abortIfNeeded`. That method throws an `AbortedException` if the current is thread interrupted. Given that `.close()` is usually called when on a cleanup path anyway, is this necessary? Usually `close()` methods should just try to clean up and return with as little fanfare as possible. `AbortedException` is also an unchecked exception so it may bypass any code anticipating `IOException`.

### Regression Issue

- [ ] Select this option if this issue appears to be a regression.

### Expected Behavior

Closing a `SdkFilterInputStream` doesn't throw exceptions it doesn't have to.

### Current Behavior

`SdkFilterInputStream.close` may throw `AbortedException`.

### Reproduction Steps

I hope the problem is clear from the description.

### Possible Solution

Delete the `SdkFilterInputStream.close` override.

### Additional Information/Context

_No response_

### AWS Java SDK version used

2.42.33

### JDK version used

any

### Operating System and version

any

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.