Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Wed, 20 Aug 2025 08:30:11 +0000 Subject: [pgjdbc/pgjdbc] PR #3778: fix: avoid IllegalStateException: Timer already cancelled when StatementCancelTimerTask.run throws a runtime error List-Id: X-GitHub-Author-Id: 213894 X-GitHub-Author-Login: vlsi X-GitHub-Issue: 3778 X-GitHub-Labels: bug X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: merged X-GitHub-Type: pull_request X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3778 Content-Type: text/plain; charset=utf-8 Previously, StatementCancelTimerTask might propagate runtime errors to java.util.Timer which causes the Timer to cancel itself. We don't want that behavior, so we should avoid throwing errors from TimerTask implementations. Note statement.cancelIfStillNeeded has already been ignoring SQLExceptions from statement.cancel() for quite a while, however, it did not ignore runtime errors. Fixes https://github.com/pgjdbc/pgjdbc/issues/3530