Skip to content

Fix releasePartialSequences value propagation for SequenceSizeReleaseStrategy #10004

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

Merged
merged 3 commits into from
May 2, 2025

Conversation

mjd507
Copy link
Contributor

@mjd507 mjd507 commented May 2, 2025

Fixes: #10003
Issue Link: #10003

Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

Play attention how title of this PR is broken.
Our preferences is to have a first line of the first commit message not longer that 50 symbols. That one becomes a PR title, plus it is easy to read commit history for GIt.

There is also an article by our former colleague explaining an importance of good commit message: https://cbea.ms/git-commit/

@@ -173,7 +175,7 @@ public void testAggPerfDefaultPartial() throws InterruptedException, ExecutionEx

Collection<?> result = resultFuture.get(10, TimeUnit.SECONDS);
assertThat(result).isNotNull();
assertThat(result.size()).isEqualTo(120000);
assertThat(result.size()).isEqualTo(1);
Copy link
Member

Choose a reason for hiding this comment

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

Why do you do a modification into a test if you don't enable it back?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if I enable it, the value is equal to 1, so I change to 1 but keep it disabled. :)

I think we can also remove handler.setReleasePartialSequences(true); so it will be 12000.

Copy link
Member

Choose a reason for hiding this comment

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

Well, I think the may reason behind disabling this test is its timing.
If it is takes like 5 seconds, then it is not OK.
We may indeed remodel it for a smaller number of items to aggregate though.

Copy link
Member

Choose a reason for hiding this comment

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

Just nit-pick for this line:

assertThat(result).hasSize(1);

However, I worry about about the reasoning behind this test.
Looks like its idea is to demonstrate a performance improvement.
Therefore talking about partial sequence is some kind of copy/paste artifact.
And if we end up just expecting a one item in the end, then it is not about performance for the whole sequence.

So, my conclusion is just to remove that handler.setReleasePartialSequences(true); from this test and enable it back.
Looks like on my laptop this tests takes just only 2,5 seconds.

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, I run this method more than 10 times this afternoon, only 1 time very slow, morn than 1min.
cam I still mark it as Disabled, and remove handler.setReleasePartialSequences(true);

Copy link
Member

Choose a reason for hiding this comment

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

Sure!
Let's keep it disabled, but remove the config which is not related to the logic if the test!

Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

Please, consider to follow DCO: https://spring.io/blog/2025/01/06/hello-dco-goodbye-cla-simplifying-contributions-to-spring.

Otherwise, we even cannot review your PR, not talking about accepting.

Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

Looks like DCO complains that suggestion sign-off by is not what your Git user provides:

 Author: Jiandong, Committer: Jiandong; Expected "Jiandong [[email protected]](mailto:[email protected])", but got "Jiandong Ma [[email protected]](mailto:[email protected])".

@mjd507
Copy link
Contributor Author

mjd507 commented May 2, 2025

Looks like DCO complains that suggestion sign-off by is not what your Git user provides:

true, my IDEA commit panel and terminal use different email account ...

@mjd507 mjd507 requested a review from artembilan May 2, 2025 15:07
@@ -173,7 +175,7 @@ public void testAggPerfDefaultPartial() throws InterruptedException, ExecutionEx

Collection<?> result = resultFuture.get(10, TimeUnit.SECONDS);
assertThat(result).isNotNull();
assertThat(result.size()).isEqualTo(120000);
assertThat(result.size()).isEqualTo(1);
Copy link
Member

Choose a reason for hiding this comment

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

Just nit-pick for this line:

assertThat(result).hasSize(1);

However, I worry about about the reasoning behind this test.
Looks like its idea is to demonstrate a performance improvement.
Therefore talking about partial sequence is some kind of copy/paste artifact.
And if we end up just expecting a one item in the end, then it is not about performance for the whole sequence.

So, my conclusion is just to remove that handler.setReleasePartialSequences(true); from this test and enable it back.
Looks like on my laptop this tests takes just only 2,5 seconds.

mjd507 added 2 commits May 2, 2025 23:25
Signed-off-by: Jiandong Ma <[email protected]>
Signed-off-by: Jiandong Ma <[email protected]>
Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

LGTM.

As long as the PR build is green, it will be merged.

Thank you for contribution; looking forward for more!

@artembilan artembilan merged commit c58e218 into spring-projects:main May 2, 2025
3 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.

The value of releasePartialSequences is not propagated to the underlying SequenceSizeReleaseStrategy
2 participants