Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix faults in incremental and parallel builds #762

Merged
merged 1 commit into from
Nov 27, 2019

Conversation

theosotr
Copy link
Contributor

Hello

This commit fixes a couple of faults in the incremental and parallel builds of this project.

First, it makes the time-consuming task generateCodecs incremental.

Second, it fixes a race condition related to the creation of the sources Jar. In particular, sourcesJar must be executed after the task generateCodecs. Otherwise, the created jar does not include the files generated by this task.

These are the files that are missing when sourcesJar runs before generateCodecs:

< io/aeron/cluster/codecs/
< io/aeron/cluster/codecs/SessionCloseRequestDecoder.java
< io/aeron/cluster/codecs/ClientSessionEncoder.java
< io/aeron/cluster/codecs/ChallengeResponseEncoder.java
< io/aeron/cluster/codecs/ElectionStartEventDecoder.java
< io/aeron/cluster/codecs/ClusterAction.java
< io/aeron/cluster/codecs/VarDataEncodingDecoder.java
< io/aeron/cluster/codecs/NewLeaderEventEncoder.java
< io/aeron/cluster/codecs/AddPassiveMemberEncoder.java
< io/aeron/cluster/codecs/ClusterMembersExtendedResponseDecoder.java
< io/aeron/cluster/codecs/ClusterTimeUnit.java
< io/aeron/cluster/codecs/SnapshotRecordingsDecoder.java
< io/aeron/cluster/codecs/CanvassPositionEncoder.java
< io/aeron/cluster/codecs/SessionCloseEventDecoder.java
< io/aeron/cluster/codecs/SnapshotRecordingsEncoder.java
< io/aeron/cluster/codecs/SessionKeepAliveEncoder.java
< io/aeron/cluster/codecs/VarDataEncodingEncoder.java
< io/aeron/cluster/codecs/MessageHeaderEncoder.java
< io/aeron/cluster/codecs/CatchupPositionEncoder.java
< io/aeron/cluster/codecs/NewLeaderEventDecoder.java
< io/aeron/cluster/codecs/SnapshotRecordingQueryDecoder.java
< io/aeron/cluster/codecs/TimerDecoder.java
< io/aeron/cluster/codecs/ClientSessionDecoder.java
< io/aeron/cluster/codecs/CommitPositionDecoder.java
< io/aeron/cluster/codecs/BackupQueryEncoder.java
< io/aeron/cluster/codecs/ClusterMembersChangeEncoder.java
< io/aeron/cluster/codecs/ServiceTerminationPositionEncoder.java
< io/aeron/cluster/codecs/JoinClusterDecoder.java
< io/aeron/cluster/codecs/AddPassiveMemberDecoder.java
< io/aeron/cluster/codecs/CloseSessionDecoder.java
< io/aeron/cluster/codecs/RemoveMemberEncoder.java
< io/aeron/cluster/codecs/BackupResponseDecoder.java
< io/aeron/cluster/codecs/ChallengeEncoder.java
< io/aeron/cluster/codecs/ClusterMembersExtendedResponseEncoder.java
< io/aeron/cluster/codecs/StopCatchupEncoder.java
< io/aeron/cluster/codecs/ClusterMembersResponseDecoder.java
< io/aeron/cluster/codecs/ClusterSessionEncoder.java
< io/aeron/cluster/codecs/SessionConnectRequestEncoder.java
< io/aeron/cluster/codecs/BooleanType.java
< io/aeron/cluster/codecs/AppendedPositionDecoder.java
< io/aeron/cluster/codecs/ChallengeResponseDecoder.java
< io/aeron/cluster/codecs/BackupResponseEncoder.java
< io/aeron/cluster/codecs/SnapshotMarkerEncoder.java
< io/aeron/cluster/codecs/ClusterActionRequestDecoder.java
< io/aeron/cluster/codecs/JoinClusterEncoder.java
< io/aeron/cluster/codecs/NewLeadershipTermDecoder.java
< io/aeron/cluster/codecs/VarAsciiEncodingEncoder.java
< io/aeron/cluster/codecs/SessionEventDecoder.java
< io/aeron/cluster/codecs/RemoveMemberDecoder.java
< io/aeron/cluster/codecs/TerminationAckDecoder.java
< io/aeron/cluster/codecs/SessionOpenEventDecoder.java
< io/aeron/cluster/codecs/RequestVoteEncoder.java
< io/aeron/cluster/codecs/ScheduleTimerEncoder.java
< io/aeron/cluster/codecs/CloseReason.java
< io/aeron/cluster/codecs/ScheduleTimerDecoder.java
< io/aeron/cluster/codecs/SessionCloseRequestEncoder.java
< io/aeron/cluster/codecs/TimerEncoder.java
< io/aeron/cluster/codecs/VoteDecoder.java
< io/aeron/cluster/codecs/AppendedPositionEncoder.java
< io/aeron/cluster/codecs/ClusterSessionDecoder.java
< io/aeron/cluster/codecs/SnapshotRecordingQueryEncoder.java
< io/aeron/cluster/codecs/GroupSizeEncodingDecoder.java
< io/aeron/cluster/codecs/TerminationAckEncoder.java
< io/aeron/cluster/codecs/TerminationPositionDecoder.java
< io/aeron/cluster/codecs/ClusterMembersQueryEncoder.java
< io/aeron/cluster/codecs/ClusterMembersResponseEncoder.java
< io/aeron/cluster/codecs/ClusterActionRequestEncoder.java
< io/aeron/cluster/codecs/SessionOpenEventEncoder.java
< io/aeron/cluster/codecs/MembershipChangeEventDecoder.java
< io/aeron/cluster/codecs/ClusterMembersChangeDecoder.java
< io/aeron/cluster/codecs/MembershipChangeEventEncoder.java
< io/aeron/cluster/codecs/CanvassPositionDecoder.java
< io/aeron/cluster/codecs/RequestVoteDecoder.java
< io/aeron/cluster/codecs/VarAsciiEncodingDecoder.java
< io/aeron/cluster/codecs/CommitPositionEncoder.java
< io/aeron/cluster/codecs/ElectionStartEventEncoder.java
< io/aeron/cluster/codecs/GroupSizeEncodingEncoder.java
< io/aeron/cluster/codecs/TimerEventDecoder.java
< io/aeron/cluster/codecs/SnapshotMark.java
< io/aeron/cluster/codecs/TerminationPositionEncoder.java
< io/aeron/cluster/codecs/SessionMessageHeaderDecoder.java
< io/aeron/cluster/codecs/NewLeadershipTermEncoder.java
< io/aeron/cluster/codecs/SessionKeepAliveDecoder.java
< io/aeron/cluster/codecs/MetaAttribute.java
< io/aeron/cluster/codecs/mark/
< io/aeron/cluster/codecs/mark/MessageHeaderEncoder.java
< io/aeron/cluster/codecs/mark/VarAsciiEncodingEncoder.java
< io/aeron/cluster/codecs/mark/VarAsciiEncodingDecoder.java
< io/aeron/cluster/codecs/mark/ClusterComponentType.java
< io/aeron/cluster/codecs/mark/MetaAttribute.java
< io/aeron/cluster/codecs/mark/MessageHeaderDecoder.java
< io/aeron/cluster/codecs/mark/MarkFileHeaderDecoder.java
< io/aeron/cluster/codecs/mark/MarkFileHeaderEncoder.java
< io/aeron/cluster/codecs/mark/package-info.java
< io/aeron/cluster/codecs/StopCatchupDecoder.java
< io/aeron/cluster/codecs/CatchupPositionDecoder.java
< io/aeron/cluster/codecs/JoinLogDecoder.java
< io/aeron/cluster/codecs/EventCode.java
< io/aeron/cluster/codecs/SessionCloseEventEncoder.java
< io/aeron/cluster/codecs/SessionConnectRequestDecoder.java
< io/aeron/cluster/codecs/CancelTimerDecoder.java
< io/aeron/cluster/codecs/NewLeadershipTermEventEncoder.java
< io/aeron/cluster/codecs/ServiceAckEncoder.java
< io/aeron/cluster/codecs/MessageHeaderDecoder.java
< io/aeron/cluster/codecs/ClusterMembersQueryDecoder.java
< io/aeron/cluster/codecs/JoinLogEncoder.java
< io/aeron/cluster/codecs/CloseSessionEncoder.java
< io/aeron/cluster/codecs/SessionEventEncoder.java
< io/aeron/cluster/codecs/TimerEventEncoder.java
< io/aeron/cluster/codecs/ClusterMembersEncoder.java
< io/aeron/cluster/codecs/ChallengeDecoder.java
< io/aeron/cluster/codecs/ClusterMembersDecoder.java
< io/aeron/cluster/codecs/ChangeType.java
< io/aeron/cluster/codecs/CancelTimerEncoder.java
< io/aeron/cluster/codecs/ConsensusModuleDecoder.java
< io/aeron/cluster/codecs/ConsensusModuleEncoder.java
< io/aeron/cluster/codecs/ServiceAckDecoder.java
< io/aeron/cluster/codecs/NewLeadershipTermEventDecoder.java
< io/aeron/cluster/codecs/VoteEncoder.java
< io/aeron/cluster/codecs/SessionMessageHeaderEncoder.java
< io/aeron/cluster/codecs/BackupQueryDecoder.java
< io/aeron/cluster/codecs/ServiceTerminationPositionDecoder.java
< io/aeron/cluster/codecs/SnapshotMarkerDecoder.java
< io/aeron/cluster/codecs/package-info.java

Similarly, the task shadowJar conflicts wit the task jar. Specifically, the name of the generated shadow jar (i.e., aeron-all/build/libs/aeron-all-1.24.0-SNAPSHOT.jar) conflicts with that produced by the naive jar task. So depending on the order in which Gradle processes task, the resulting jar might have incorrect contents.

build.gradle Outdated
@@ -386,6 +386,13 @@ project(':aeron-archive') {
}

task generateCodecs(type: JavaExec) {
def codecsFile = 'src/main/resources/aeron-cluster-codecs.xml'
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this not be aeron-archive-codecs.xml

build.gradle Outdated
@@ -502,6 +511,13 @@ project(':aeron-cluster') {
}

task generateCodecs(type: JavaExec) {
def codecsFile = 'src/main/resources/aeron-cluster-codecs.xml'
def markCodecsFile = 'src/main/resources/aeron-archive-mark-codecs.xml'
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this not be aeron-cluster-mark-codecs.xml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you are right. Thanks for spotting this.
Fixed

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