aws / aws/aws-sdk-java-v2

SdkFilterInputStream.close should not abort

Aperta
#6,906 2 commenti 0 reazioni 1 assegnatario Rivendicata da @debora-ito Vedi su GitHub
bug p2
Lingua principale
Java
Stelle
2.6k
Fork
1k
Merge medio
2g 9h
PR unite (30g)
51

Descrizione

### 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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.