Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@wojciech-adaptive
Copy link
Contributor

An implementation of #1791 (comment)

@wojciech-adaptive wojciech-adaptive force-pushed the publish-leader-hb-timeout branch from bcf599d to 1dddf62 Compare May 21, 2025 12:53
@wojciech-adaptive wojciech-adaptive requested a review from mikeb01 May 21, 2025 13:47
@wojciech-adaptive wojciech-adaptive marked this pull request as ready for review May 21, 2025 13:47
Comment on lines +2457 to +2462
if (ctx.newLeaderTimeoutNs() == NULL_VALUE)
{
ctx.newLeaderTimeoutNs(2 * (leaderHeartbeatTimeoutNs != NULL_VALUE ?
leaderHeartbeatTimeoutNs : ConsensusModule.Configuration.LEADER_HEARTBEAT_TIMEOUT_DEFAULT_NS));
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Why keep AeronCluster.Context#newLeaderTimeoutNs(long) given that we get value from the Cluster itself? After all we wanted to simplify configuration by implementing this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For tests and in case there are any unusual setups where the default doesn't work.

Copy link
Contributor

Choose a reason for hiding this comment

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

For tests we can keep this functionality package-private.

Copy link
Contributor

Choose a reason for hiding this comment

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

On the other hand, if we do keep it public why isn't there a system property for it then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For tests we can keep this functionality package-private.

I wouldn't assume it would be useful for our tests only.

On the other hand, if we do keep it public why isn't there a system property for it then?

Don't mind adding one. We don't have properties for everything, I guess only the typical options.

Copy link
Contributor

Choose a reason for hiding this comment

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

To me newLeaderTimeoutNs is similar to messageTimeoutNs which is configurable via the system properties. So I suggest we add one for the former as well.

@vyazelenko
Copy link
Contributor

Overall looks good. The only issue is the remaining config option which we should hide/remove.

@wojciech-adaptive
Copy link
Contributor Author

@wojciech-adaptive This change will break the old clients, i.e. if Cluster is upgraded but the client not then the SessionEvent message will not be readable. In particular sessionEventDecoder.detail() will blow up as it will interpret first 4 bytes of the new field as the length of the detail string.

Can you please elaborate? SBE supports versioning and as far as I see we use codecs correctly, i.e. they will account for different block lengths.

@vyazelenko
Copy link
Contributor

Can you please elaborate? SBE supports versioning and as far as I see we use codecs correctly, i.e. they will account for different block lengths.

You are absolutely right. I got confused. No problem here.

P.S. I've pushed a test that proves that such change works. b3635fe

@vyazelenko vyazelenko merged commit 313bc16 into aeron-io:master May 23, 2025
45 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.

2 participants