softwaremill / softwaremill/bootzooka

After Magnum is updated, update logging to not log at error-level SQL

Open
#1,516 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
786
Forks
149
Avg merge
2h 22m
Merged PRs (30d)
112

Description

Exceptions such as:

backend java.net.SocketException: Closed by interrupt
backend 	at java.base/java.net.Socket$SocketInputStream.read(Socket.java:1106)
backend 	at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:192)
backend 	at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:159)
backend 	at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:144)
backend 	at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:76)
backend 	at org.postgresql.core.PGStream.receiveChar(PGStream.java:477)
backend 	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2175)
backend 	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:372)
backend 	... 128 common frames omitted
backend Wrapped by: org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend.

which originate from an interruption, should be only DEBUG-log. Such filtering is already present OOTB in NettySyncServerOptions for InterruptedException

Magnum fix to get the right exceptions context: https://github.com/AugustNagro/magnum/pull/126

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Magnum fix linked in the issue, then inspect the existing filtering in NettySyncServerOptions for InterruptedException. Trace how the PostgreSQL interruption exceptions reach logging and verify that they are emitted at DEBUG rather than ERROR after Magnum is updated.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql
Domain
backend, databases, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.