IGNITE-28203 Use MarshalableMessage for ErrorMessage#12878
IGNITE-28203 Use MarshalableMessage for ErrorMessage#12878anton-vinogradov merged 13 commits intoapache:masterfrom
Conversation
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
Outdated
Show resolved
Hide resolved
Possible compatibility issues. Please, check rolling upgrade casesThis PR modifies protected classes (with Order annotation). Affected files:
|
...re/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
Outdated
Show resolved
Hide resolved
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
Outdated
Show resolved
Hide resolved
...ore/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoveryMessageFactory.java
Outdated
Show resolved
Hide resolved
|
|
||
| /** {@inheritDoc} */ | ||
| @Override public void prepareMarshal(GridCacheSharedContext<?, ?> ctx) throws IgniteCheckedException { | ||
| if (err != null) |
There was a problem hiding this comment.
Usually, we do && errBytes == null
There was a problem hiding this comment.
Yes, and the reason is not clear for me.
This MUST happen once.
|
|
||
| /** {@inheritDoc} */ | ||
| @Override public void prepareUnmarshal(GridCacheSharedContext<?, ?> ctx) throws IgniteCheckedException { | ||
| if (errBytes != null) |
There was a problem hiding this comment.
Usually w no && err == null
There was a problem hiding this comment.
Yes, and the reason is not clear for me.
This MUST happen once.
| /** {@inheritDoc} */ | ||
| @Override public void prepareUnmarshal(GridCacheSharedContext<?, ?> ctx) throws IgniteCheckedException { | ||
| if (errBytes != null) | ||
| err = U.unmarshal(ctx.marshaller(), errBytes, U.resolveClassLoader(ctx.cache().context().gridConfig())); |
There was a problem hiding this comment.
no keed to keep the bytes any more. Less memory consumption
There was a problem hiding this comment.
Just let gc do it work.
This message has short life. Everything will be cleared after use.
There was a problem hiding this comment.
GC won't deal with alive not nulls. My suggestion is not to consider how long message lives. Just do not keep obsoletes. WDYT?
There was a problem hiding this comment.
I'ts a preoptimisation.
Don't like such things.
modules/codegen/src/main/java/org/apache/ignite/internal/MessageSerializerGenerator.java
Outdated
Show resolved
Hide resolved
modules/codegen/src/main/java/org/apache/ignite/internal/MessageSerializerGenerator.java
Outdated
Show resolved
Hide resolved
| } | ||
| /** {@inheritDoc} */ | ||
| @Override public void finishUnmarshal(Marshaller marsh, ClassLoader clsLdr) throws IgniteCheckedException { | ||
| if (errBytes != null) |
There was a problem hiding this comment.
Usually we do && err != null. The same in the other places
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java
Outdated
Show resolved
Hide resolved
...ore/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoveryMessageFactory.java
Outdated
Show resolved
Hide resolved
| } | ||
| @Override public void finishUnmarshal(Marshaller marsh, ClassLoader clsLdr) throws IgniteCheckedException { | ||
| if (msgsBytes != null) | ||
| msgs = U.unmarshal(marsh, msgsBytes, clsLdr); |
There was a problem hiding this comment.
Let's do not keep msgsBytes any more.
| List<MessageFactoryProvider> compMsgs = new ArrayList<>(); | ||
|
|
||
| compMsgs.add(new GridIoMessageFactory()); | ||
| compMsgs.add(new GridIoMessageFactory(marsh, U.gridClassLoader())); |
There was a problem hiding this comment.
Why not ctx.marshallerContext().jdkMarshaller() ? Is widely used.
There was a problem hiding this comment.
Has no answer, unfortunatelly
|


Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
The Contribution Checklist
The description explains WHAT and WHY was made instead of HOW.
The following pattern must be used:
IGNITE-XXXX Change summarywhereXXXX- number of JIRA issue.(see the Maintainers list)
the
green visaattached to the JIRA ticket (see tabPR Checkat TC.Bot - Instance 1 or TC.Bot - Instance 2)Notes
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.