Message-ID: From: "lfgcampos (@lfgcampos)" To: "pgjdbc/pgjdbc" Date: Fri, 06 Jun 2025 10:12:19 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #3530: JDBC Shared Timer set to cancelled In-Reply-To: References: List-Id: X-GitHub-Author-Login: lfgcampos X-GitHub-Comment-Id: 2948773054 X-GitHub-Comment-Type: issue_comment X-GitHub-Edited-At: 2025-06-06T10:58:59Z X-GitHub-Issue: 3530 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3530#issuecomment-2948773054 Content-Type: text/plain; charset=utf-8 We faced an outage related to this (my assumption) when we upgraded from `42.7.4` to `42.7.6`. Stacktrace is as follow: ``` Caused by: java.lang.IllegalStateException: Timer already cancelled. at java.base/java.util.Timer.sched(Unknown Source) at java.base/java.util.Timer.schedule(Unknown Source) at org.postgresql.jdbc.PgConnection.addTimerTask(PgConnection.java:1363) at org.postgresql.jdbc.PgStatement.startTimer(PgStatement.java:993) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:517) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:435) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:196) at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:182) ``` we are still investigating but sharing this earlier in case it helps anything! as soon as I get more info, I will update here as well ---- update1: I also found this on our logs, which seems somehow related ``` NullPointerException Cannot read the array length because the return value of "org.postgresql.util.internal.Nullness.castNonNull(Object)" is null ... org.postgresql.core.QueryExecutorBase in sendQueryCancel at line 199 org.postgresql.jdbc.PgConnection in cancelQuery at line 1220 org.postgresql.jdbc.PgStatement in cancel at line 926 org.postgresql.jdbc.PgStatement in cancelIfStillNeeded at line 1003 org.postgresql.jdbc.StatementCancelTimerTask in run at line 36 java.util.TimerThread in mainLoop java.util.TimerThread in run ```