Skip to content

IGNITE-27996 One SingleNodeMessage can be serialized numerous times during sending#12824

Open
zstan wants to merge 1 commit intoapache:masterfrom
zstan:ignite-27996
Open

IGNITE-27996 One SingleNodeMessage can be serialized numerous times during sending#12824
zstan wants to merge 1 commit intoapache:masterfrom
zstan:ignite-27996

Conversation

@zstan
Copy link
Contributor

@zstan zstan commented Feb 26, 2026

No description provided.


case 2:
if (!writer.writeByteArray(U.toBytes(resp)))
if (respBytes == null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary '{ }' according to Ignite codestyle.

}

return res;
return Collections.unmodifiableMap(res);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to test the usage of unmodifiable collection here?


/** {@inheritDoc} */
@Override protected void afterTest() {
stopAllGrids();
Copy link
Contributor

@oleg-vlsk oleg-vlsk Mar 2, 2026

Choose a reason for hiding this comment

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

Don't we need super.afterTest() here?

/** */
private static class TestDiscoverySpi extends TcpDiscoverySpi {
/** */
private CountDownLatch messageLatch;
Copy link
Contributor

Choose a reason for hiding this comment

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

'Msg' should be used according to Ignite abbreviation standards.

private CountDownLatch messageLatch;

/** Message raized trigger. */
void messageLatch(CountDownLatch messageLatch) {
Copy link
Contributor

Choose a reason for hiding this comment

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

'Msg' should be used according to Ignite abbreviation standards.

super(
ctx,
TEST_PROCESS,
(req) -> new GridFinishedFuture<>(req),
Copy link
Contributor

Choose a reason for hiding this comment

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

Method reference may be used here instead of lambda.


discoSpi.messageLatch(latch);

Set<UUID> nodeIdsRes = new HashSet<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

As an option to avoid the for-loop below:

Set<UUID> nodeIdsRes = grid(0).cluster().forServers().nodes().stream().map(ClusterNode::id).collect(Collectors.toSet());

@Test
public void testSingleSerializedOnce() throws Exception {
startGridsMultiThreaded(NODES_CNT);
startClientGrid(NODES_CNT);
Copy link
Contributor

Choose a reason for hiding this comment

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

We use grid(NODES_CNT) 3 times in the test, maybe it's worth introducing a local variable like this:

IgniteEx client = startClientGrid(NODES_CNT);


TestRecordingCommunicationSpi clnCommSpi = TestRecordingCommunicationSpi.spi(grid(NODES_CNT));

assertTrue(grid(NODES_CNT).configuration().isClientMode());
Copy link
Contributor

Choose a reason for hiding this comment

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

I would move this line before TestRecordingCommunicationSpi initialization for better readability, unless there's a certain reason why this assertion is done after it?

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.

2 participants