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

Update airbase to 140 #17740

Closed
wants to merge 1 commit into from
Closed

Conversation

wendigo
Copy link
Contributor

@wendigo wendigo commented Jun 2, 2023

This change makes it possible to build project with project.build.targetJdk 21.

The only remaining maven infrastructure bit that doesn't work under JDK 21 is error-prone but the current HEAD fixes those problems so it's a matter of updating error-prone when the next version is released.

This also brings Guava to version 32.0.0 (https://github.com/google/guava/releases/tag/v32.0.0)

@wendigo
Copy link
Contributor Author

wendigo commented Jun 2, 2023

@martint these are the only violations after Guava dropped @CanIgnoreReturnValue from a bunch of methods. There are no new violations with updated Guava and error-prone HEAD version besides those in that PR.

@wendigo wendigo force-pushed the serafin/airbase-140 branch from b0e8fd8 to 7d9e25c Compare June 2, 2023 20:24
@wendigo wendigo requested a review from martint June 2, 2023 20:26
@wendigo wendigo force-pushed the serafin/airbase-140 branch from 7d9e25c to 71f6086 Compare June 2, 2023 20:29
@github-actions github-actions bot added the hudi Hudi connector label Jun 2, 2023
@wendigo wendigo requested a review from hashhar June 5, 2023 08:52
@@ -62,6 +62,7 @@ public HudiBackgroundSplitLoader(
this.hudiSplitFactory = new HudiSplitFactory(tableHandle, hudiSplitWeightProvider);
}

@SuppressWarnings("CheckReturnValue")
Copy link
Member

Choose a reason for hiding this comment

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

why exactly? (the links from commit desc do not explain)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to the FutureCombiner javadoc and error-prone FutureReturnValueIgnored:

Return value of methods returning Future must be checked. Ignoring returned Futures suppresses exceptions thrown from the code that completes the Future.

The problem
Methods that return java.util.concurrent.Future and its subclasses generally indicate errors by returning a future that eventually fails.

If you don’t check the return value of these methods, you will never find out if they threw an exception.

Nested futures can also result in missed cancellation signals or suppressed exceptions - see [Avoiding Nested Futures](https://github.com/google/guava/wiki/ListenableFutureExplained#avoid-nested-futures) for details.

Copy link
Member

Choose a reason for hiding this comment

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

Document why it's correct to do this suppression. Ask Hudi people if we don't know

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've hooked the same listener on this combined future as in other places.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@codope @7c00 does it look right to you?

Copy link
Member

@hashhar hashhar left a comment

Choose a reason for hiding this comment

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

LGTM % Lukasz's comment. suppressions should have reasons ideally so that people can revisit them

This change makes it possible to build project with project.build.targetJdk 21.

Additionally suppress error-prone `CheckReturnValue` violations with Guava 32.0.0

These are the result of following changes:

- google/guava@a7f6b08
- google/guava@0ef6688
@wendigo wendigo force-pushed the serafin/airbase-140 branch from 71f6086 to ddb7b09 Compare June 5, 2023 12:28
@@ -70,7 +70,8 @@ public void testCounter()
futures.add(executor.submit(() -> {
try {
// wait for the go signal
awaitUninterruptibly(startLatch, 1, TimeUnit.MINUTES);
@SuppressWarnings("CheckReturnValue")
boolean ignored = awaitUninterruptibly(startLatch, 1, TimeUnit.MINUTES);
Copy link
Member

Choose a reason for hiding this comment

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

why ignore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To leave the behavior as it was before.

Copy link
Member

Choose a reason for hiding this comment

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

this is a test, so it would not be unsafe to just improve it

Copy link
Member

Choose a reason for hiding this comment

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

Agreed, I would make all these assertTrue(...)

@@ -74,7 +74,7 @@ public void start()
.map(partition -> Futures.submit(() -> loadSplits(partition), executor))
.peek(this::hookErrorListener)
.collect(Collectors.toList());
Futures.whenAllComplete(futures).run(asyncQueue::finish, directExecutor());
hookErrorListener(Futures.whenAllComplete(futures).run(asyncQueue::finish, directExecutor()));
Copy link
Contributor

Choose a reason for hiding this comment

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

@wendigo Shouldn't the hook on line 81 be sufficient?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It’s about ignoring return value of the combiner call. What would you propose instead adding a hook?

Copy link
Member

Choose a reason for hiding this comment

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

@codope here we add a hook for asyncQueue::finish potential failures

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I’ve migrated this change to other PR. Seems to work just fine

@wendigo
Copy link
Contributor Author

wendigo commented Jun 7, 2023

Superseded by #17770

@wendigo wendigo closed this Jun 7, 2023
@wendigo wendigo deleted the serafin/airbase-140 branch June 7, 2023 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed hudi Hudi connector
Development

Successfully merging this pull request may close these issues.

7 participants