Skip to content

Commit 9627185

Browse files
oschwaldclaude
andcommitted
STF-322: Restore interrupt flag in InterruptedException rewrap path
The existing catch (InterruptedException) blocks in reportTransaction() and responseFor() rewrap into MinFraudException without restoring the thread's interrupt status, silently swallowing the cancellation signal. Per Java's interruption protocol, code that catches InterruptedException without rethrowing it should re-set the flag so callers up the stack can observe the cancellation. This is an independent bug fix bundled into the STF-322 retry work because the retry feature exposes the path more often. Per project commit hygiene it lands as a separate commit so it can be cherry-picked or reverted on its own. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d2480a4 commit 9627185

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/main/java/com/maxmind/minfraud/WebServiceClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ public void reportTransaction(TransactionReport transaction) throws IOException,
351351
maybeThrowException(response, uri);
352352
exhaustBody(response);
353353
} catch (InterruptedException e) {
354+
Thread.currentThread().interrupt();
354355
throw new MinFraudException("Interrupted sending request", e);
355356
} finally {
356357
if (response != null) {
@@ -372,6 +373,7 @@ private <T> T responseFor(String service, AbstractModel transaction, Class<T> cl
372373
response = sendWithRetry(request);
373374
return handleResponse(response, uri, cls);
374375
} catch (InterruptedException e) {
376+
Thread.currentThread().interrupt();
375377
throw new MinFraudException("Interrupted sending request", e);
376378
} finally {
377379
if (response != null) {

0 commit comments

Comments
 (0)