IGNITE-28310 Optimize ClientInboundMessageHandler#writeError#7943
Merged
ptupitsyn merged 4 commits intoapache:mainfrom Apr 8, 2026
Merged
IGNITE-28310 Optimize ClientInboundMessageHandler#writeError#7943ptupitsyn merged 4 commits intoapache:mainfrom
ptupitsyn merged 4 commits intoapache:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR optimizes server-to-client error serialization by simplifying stack trace extraction and reducing allocations when packing stack traces into MsgPack messages (used by the thin client protocol).
Changes:
- Simplify
ExceptionUtils.getFullStackTraceto rely onThrowable#printStackTraceand return aCharSequenceto avoid an extratoString()allocation. - Broaden
ClientMessagePacker.packStringto acceptCharSequence, enabling direct packing ofStringBuffer/StringBuilderwithout conversion. - Update test fixture matcher to adapt to the new
CharSequencereturn type.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/matchers/CompletableFutureExceptionMatcher.java | Adjusts mismatch description building to handle CharSequence stack traces. |
| modules/core/src/main/java/org/apache/ignite/internal/util/ExceptionUtils.java | Reworks full stack trace extraction and changes the return type to CharSequence. |
| modules/client-common/src/main/java/org/apache/ignite/internal/client/proto/ClientMessagePacker.java | Updates packString API to accept CharSequence for lower-allocation packing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
modules/core/src/main/java/org/apache/ignite/internal/util/ExceptionUtils.java
Show resolved
Hide resolved
modules/core/src/main/java/org/apache/ignite/internal/util/ExceptionUtils.java
Show resolved
Hide resolved
modules/core/src/main/java/org/apache/ignite/internal/util/ExceptionUtils.java
Outdated
Show resolved
Hide resolved
isapego
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
printStackTracetoStringcall, passCharSequencetoClientMessagePackerhttps://issues.apache.org/jira/browse/IGNITE-28310