Skip to content

fix(client-v2): classify insert write failures as transfer errors#2923

Merged
chernser merged 1 commit into
ClickHouse:mainfrom
014-code:fix/2729-insert-write-failure-classification
Jul 13, 2026
Merged

fix(client-v2): classify insert write failures as transfer errors#2923
chernser merged 1 commit into
ClickHouse:mainfrom
014-code:fix/2729-insert-write-failure-classification

Conversation

@014-code

Copy link
Copy Markdown
Contributor

Summary

Closes #2729

This PR fixes exception classification for POJO inserts in client-v2.

Previously, Client.insert(...) could wrap request-body write failures such as
java.net.SocketException: Broken pipe (Write failed) into
DataSerializationException while serializing POJOs. That made transport failures
look like serialization bugs.

This change stops catching IOException inside the POJO field serialization loop,
so write-time network failures continue through the transport error path and are
reported as DataTransferException instead.

Actual POJO reflection/serialization failures are unchanged and still surface as
DataSerializationException.

Compatibility impact:
This is a bug fix with no public API signature change. The only user-visible behavior
change is the exception type reported for request-body transport failures during
Client.insert(...).

Tests:

  • Added a regression test for a broken-pipe style write failure during POJO insert
  • Added a regression test to preserve DataSerializationException for real getter failures

Local verification:

  • mvn -pl client-v2 -am -DskipITs=true -Dtest=InsertExceptionClassificationTest -Dsurefire.failIfNoSpecifiedTests=false test

Checklist

Stop wrapping IOExceptions from the POJO insert write path as DataSerializationException so request-body transport failures keep their network classification.

Add regression coverage for both the broken-pipe write failure case and a real POJO getter failure to preserve the serialization error path.

Update the changelog for issue ClickHouse#2729.
@github-actions

Copy link
Copy Markdown

Repository collaborators can run the JMH benchmark suite against this PR by commenting:

/benchmark

Optional regression threshold override (Δ% on Time or Alloc/op; defaults to 10%):

/benchmark threshold=15

Only one benchmark run per PR is active at a time — issuing a new /benchmark comment cancels the previous run. After the run finishes a separate comment will be posted comparing it against the latest scheduled run on main; the PR check fails if any benchmark regresses by more than the threshold.

@CLAassistant

CLAassistant commented Jul 13, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@chernser

Copy link
Copy Markdown
Contributor

@014-code Thank you for the contribution!

@chernser
chernser merged commit 3a3291e into ClickHouse:main Jul 13, 2026
19 of 22 checks passed
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.

DataSerializationException caused by java.net.SocketException: Broken pipe (Write failed)

3 participants