Skip to content

Commit 5a12750

Browse files
oschwaldclaude
andcommitted
STF-322: Restore interrupt flag in InterruptedException rewrap path
The existing catch (InterruptedException) block in responseFor() rewraps into GeoIp2Exception 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 e7f2b7a commit 5a12750

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ private <T> T responseFor(String path, InetAddress ipAddress, Class<T> cls)
418418
response.body().close();
419419
}
420420
} catch (InterruptedException e) {
421+
Thread.currentThread().interrupt();
421422
throw new GeoIp2Exception("Interrupted sending request", e);
422423
}
423424
}

0 commit comments

Comments
 (0)