Skip to content

Moved map containing long running compactions to Monitor#6223

Open
dlmarion wants to merge 11 commits intoapache:mainfrom
dlmarion:move-long-running-map-to-monitor
Open

Moved map containing long running compactions to Monitor#6223
dlmarion wants to merge 11 commits intoapache:mainfrom
dlmarion:move-long-running-map-to-monitor

Conversation

@dlmarion
Copy link
Contributor

No description provided.

@dlmarion dlmarion added this to the 4.0.0 milestone Mar 17, 2026
@dlmarion dlmarion self-assigned this Mar 17, 2026
@dlmarion dlmarion marked this pull request as ready for review March 19, 2026 21:32
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class RunningCompactionInfo {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@DomGarguilo - is there a difference between this class and RunningCompactionsSummary?

var futureIter = rcFutures.iterator();
while (futureIter.hasNext()) {
var future = futureIter.next();
if (Thread.currentThread().isInterrupted()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If the thread is interrupted, then the sleep later in the code may throw an exception, if that does happen then would not get through the entire list. Also, its possible other java code could throw an exception if the thread is interrupted. Like maybe future.get() would thrown exception.

Maybe could catch interrupted exception and then zip through an cancel everything and then rethrow it?

@@ -330,7 +298,7 @@ public void run() {
ThreadPools.resizePool(pool, () -> Math.max(20, (futures.size() / 20)), poolName);

// Fetch external compaction information from the Manager
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment needs an update

@SuppressWarnings("unused")
List<ServerId> failures = ExternalCompactionUtil.getCompactionsRunningOnCompactors(this.ctx,
executor, (t) -> running.add(t));
executor.shutdownNow();
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be good to put this shutdown in a finally block so threads are not leaked if there is an exception.

In Java 21 executors are closeable, that will be nice to use eventually.

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.

3 participants