Skip to content

GRUD_DEV-1222/fix/cached-plan-issue#326

Merged
zingmane merged 5 commits into
masterfrom
GRUD_DEV-1222/fix/cache-plan-issue
Feb 12, 2026
Merged

GRUD_DEV-1222/fix/cached-plan-issue#326
zingmane merged 5 commits into
masterfrom
GRUD_DEV-1222/fix/cache-plan-issue

Conversation

@zingmane

@zingmane zingmane commented Feb 11, 2026

Copy link
Copy Markdown
Member

Submit a pull request

Related Ticket: GRUD_DEV-1222

Please make sure the following is true

  • I gave the PR a meaningful name
  • I checked that the correct target branch is selected
  • I rebased the branch on the target branch and it can be merged
  • I ran the linter and it did pass
  • I checked for unused code / dead code / debug code
  • I checked that variables/functions have meaningful names
  • I checked that the behaviour is as the documentation/task describes and I tested it
  • I updated the docs / specifications if possible
  • I could explain all that code when someone wakes me up at 3am
  • I checked that the code considers failures and not just the happy path
  • There are no new dependencies OR I listed them and explained them below
  • PR introduces no breaking changes OR I listed them and described them below
  • I added/updated tests for new/modified unit-testable functions/helpers
  • I ran the tests and they did pass

Other information/comments (e.g. reasons why points are not checked from above)

Die Lösung war, zusätzlich zum Schema reset auch den connection pool zurückzusetzen. Wenn sich in Tests die Reihenfolge von columns und ihren typen ändern, kann es sein, dass im connection pool die prepared statements nichts davon mitkriegen. Dadurch dass unser Schema sehr dynamisch ist, kann das zum Problem werden.
Ich kann nur vermuten, warum das bisher beim Test kein Problem war. Ich denke, dass einfach immer die gleiche Testtable erstellt wird und dadurch die prepared statements auch einfach immer gepasst haben. Im BE haben wir aber auch immer wieder einen flaky Test, der sich daurch evtl. erklären lässt.
Mal sehn, im Optimalfall ist das Problem auch gelöst.

@zingmane zingmane changed the title GRUD_DEV-1222/fix/cache-plan-issue GRUD_DEV-1222/fix/cached-plan-issue Feb 11, 2026
@github-actions

github-actions Bot commented Feb 11, 2026

Copy link
Copy Markdown

Test Results

1 173 tests  ±0   1 165 ✅ ±0   4m 9s ⏱️ +19s
  146 suites ±0       8 💤 ±0 
  146 files   ±0       0 ❌ ±0 

Results for commit c83a50d. ± Comparison against base commit 12ac445.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Feb 11, 2026

Copy link
Copy Markdown

File Coverage
All files 87%
com/campudus/tableaux/exceptions.scala 0%
com/campudus/tableaux/exceptions.scala 0%
com/campudus/tableaux/arguments.scala 97%
com/campudus/tableaux/Starter.scala 76%
com/campudus/tableaux/controller/SystemController.scala 99%
com/campudus/tableaux/controller/TableauxController.scala 98%
com/campudus/tableaux/controller/UserController.scala 72%
com/campudus/tableaux/controller/StructureController.scala 91%
com/campudus/tableaux/controller/MediaController.scala 79%
com/campudus/tableaux/database/historyType.scala 7%
com/campudus/tableaux/database/languageType.scala 86%
com/campudus/tableaux/database/dbType.scala 93%
com/campudus/tableaux/database/historyType.scala 66%
com/campudus/tableaux/database/database.scala 96%
com/campudus/tableaux/database/database.scala 81%
com/campudus/tableaux/database/database.scala 97%
com/campudus/tableaux/database/domain/column.scala 71%
com/campudus/tableaux/database/domain/column.scala 64%
com/campudus/tableaux/database/domain/column.scala 95%
com/campudus/tableaux/database/domain/table.scala 96%
com/campudus/tableaux/database/domain/service.scala 81%
com/campudus/tableaux/database/domain/userSetting.scala 60%
com/campudus/tableaux/database/domain/column.scala 77%
com/campudus/tableaux/database/domain/annotation.scala 14%
com/campudus/tableaux/database/domain/column.scala 48%
com/campudus/tableaux/database/domain/annotation.scala 60%
com/campudus/tableaux/database/domain/history.scala 84%
com/campudus/tableaux/database/domain/column.scala 0%
com/campudus/tableaux/database/domain/annotation.scala 83%
com/campudus/tableaux/database/domain/userSetting.scala 95%
com/campudus/tableaux/database/domain/annotation.scala 80%
com/campudus/tableaux/database/domain/userSetting.scala 94%
com/campudus/tableaux/database/domain/table.scala 98%
com/campudus/tableaux/database/domain/column.scala 0%
com/campudus/tableaux/database/domain/column.scala 95%
com/campudus/tableaux/database/domain/history.scala 60%
com/campudus/tableaux/database/domain/file.scala 72%
com/campudus/tableaux/database/domain/userSetting.scala 90%
com/campudus/tableaux/database/domain/userSetting.scala 0%
com/campudus/tableaux/database/domain/column.scala 90%
com/campudus/tableaux/database/domain/domainobject.scala 99%
com/campudus/tableaux/database/domain/column.scala 92%
com/campudus/tableaux/database/domain/column.scala 78%
com/campudus/tableaux/database/domain/domainobject.scala 93%
com/campudus/tableaux/database/domain/column.scala 89%
com/campudus/tableaux/database/model/HistoryModel.scala 98%
com/campudus/tableaux/database/model/FolderModel.scala 95%
com/campudus/tableaux/database/model/UserModel.scala 99%
com/campudus/tableaux/database/model/AttachmentModel.scala 82%
com/campudus/tableaux/database/model/TableauxModel.scala 91%
com/campudus/tableaux/database/model/StructureModel.scala 95%
com/campudus/tableaux/database/model/SystemModel.scala 85%
com/campudus/tableaux/database/model/FileModel.scala 94%
com/campudus/tableaux/database/model/structure/ColumnModel.scala 88%
com/campudus/tableaux/database/model/structure/ColumnModel.scala 88%
com/campudus/tableaux/database/model/structure/TableModel.scala 85%
com/campudus/tableaux/database/model/structure/TableGroupModel.scala 79%
com/campudus/tableaux/database/model/tableaux/RowModel.scala 87%
com/campudus/tableaux/database/model/tableaux/RowModel.scala 93%
com/campudus/tableaux/database/model/tableaux/RowModel.scala 89%
com/campudus/tableaux/helper/FileUtils.scala 74%
com/campudus/tableaux/helper/JsonUtils.scala 95%
com/campudus/tableaux/helper/ResultChecker.scala 98%
com/campudus/tableaux/helper/IdentifierFlattener.scala 83%
com/campudus/tableaux/router/DocumentationRouter.scala 21%
com/campudus/tableaux/router/BaseRouter.scala 64%
com/campudus/tableaux/router/SystemRouter.scala 90%
com/campudus/tableaux/router/MediaRouter.scala 78%
com/campudus/tableaux/router/TableauxRouter.scala 82%
com/campudus/tableaux/router/StructureRouter.scala 99%
com/campudus/tableaux/router/RouterRegistry.scala 53%
com/campudus/tableaux/router/auth/KeycloakAuthHandler.scala 72%
com/campudus/tableaux/router/auth/permission/Condition.scala 89%
com/campudus/tableaux/router/auth/permission/Condition.scala 74%
com/campudus/tableaux/router/auth/permission/Condition.scala 87%
com/campudus/tableaux/router/auth/permission/RoleModel.scala 87%
com/campudus/tableaux/router/auth/permission/RoleModel.scala 0%
com/campudus/tableaux/router/auth/permission/Condition.scala 90%
com/campudus/tableaux/router/auth/permission/Condition.scala 79%
com/campudus/tableaux/router/auth/permission/Action.scala 97%
com/campudus/tableaux/router/auth/permission/Condition.scala 85%
com/campudus/tableaux/router/auth/permission/TableauxUser.scala 63%
com/campudus/tableaux/verticles/ThumbnailVerticle.scala 50%
com/campudus/tableaux/verticles/EventClient.scala 72%
com/campudus/tableaux/verticles/CacheVerticle.scala 76%
com/campudus/tableaux/verticles/JsonSchemaValidator.scala 86%
com/campudus/tableaux/verticles/MessagingVerticle.scala 83%

Minimum allowed coverage is 80%

Generated by 🐒 cobertura-action against c83a50d

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a targeted retry mechanism in the Vert.x PostgreSQL SQLConnection wrapper to mitigate PostgreSQL’s “cached plan must not change result type” error by discarding the affected connection and re-running the operation on a fresh connection.

Changes:

  • Detects the PostgreSQL cached-plan error via exception message matching.
  • Logs a warning and retries the failed operation using a newly acquired connection.
Comments suppressed due to low confidence (1)

src/main/scala/io/vertx/scala/SQLConnection.scala:124

  • In the cached-plan retry branch, conn is closed inside the recoverWith (line 114) but then is closed again after the recoverWith completes (line 123) when the retry succeeds. Also, newConn is only closed on the success path; if fn(newConn) fails, the _ <- close(newConn) step is skipped and the connection can leak. Restructure wrap so connections are closed exactly once and in a finally-style block (e.g., transformWith/andThen to always close), and ensure newConn is closed even when fn(newConn) fails.
          for {
            _ <- close(conn)
            newConn <- connection()
            retryResult <- fn(newConn)
            _ <- close(newConn)
          } yield retryResult
        case ex: Throwable =>
          logger.error(s"Database query/update/execute failed. Close connection.", ex)
          close(conn).flatMap(_ => Future.failed[A](ex))
      })
      _ <- close(conn)
    } yield result

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/scala/io/vertx/scala/SQLConnection.scala Outdated
Comment thread src/main/scala/io/vertx/scala/SQLConnection.scala Outdated
@zingmane zingmane merged commit 36bb454 into master Feb 12, 2026
11 checks passed
@zingmane zingmane deleted the GRUD_DEV-1222/fix/cache-plan-issue branch February 12, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants