apache / apache/druid

Prohibit Futures.addCallback(Future, Callback) (i. e. using directExecutor() implicitly) using forbidden-apis

Open
#8,756 0 comments 0 reactions 0 assignees View on GitHub
Contributions Welcome Improvement
Dominant language
Java
Stars
14.1k
Forks
3.8k
Avg merge
2d 58m
Merged PRs (30d)
233

Description

[This method is deprecated and removed from later versions of Guava for good reasons.](https://guava.dev/releases/22.0/api/docs/com/google/common/util/concurrent/Futures.html#addCallback-com.google.common.util.concurrent.ListenableFuture-com.google.common.util.concurrent.FutureCallback-) Using this method mindlessly causes problems like #8445.

While Druid is stuck with older Guava, it should prohibit the problematic method proactively using forbidden-apis, forcing specifying an executor explicitly, and actually thinking about which executor should be used.

There are currently 19 usages of this method in Druid production code.

Contributor guide

Open the contributing guide

Research direction

Start by locating Druid's forbidden-apis configuration and searching production code for the 19 Futures.addCallback(Future, Callback) usages. Update the prohibition and review each usage to specify an appropriate executor explicitly; done means the problematic overload is rejected and the build passes with all usages migrated.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.