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

How to avoid thread block while call Futures.allAsList failed throwing exceptions #5994

Closed
MyDarcy opened this issue Mar 31, 2022 · 1 comment

Comments

@MyDarcy
Copy link

MyDarcy commented Mar 31, 2022

under our prod environment,thread often blocked when Futures.allAsList failed and throw exceptions,blocked thread stack msg is as follow,so is there any routines to solve the problem ? thanks.

"xxx-thread-19" #272 blocked on java.util.logging.ConsoleHandler@574ef6ab owned by "service-storage-pool-thread-70" Id=323
   java.lang.Thread.State: BLOCKED
   @ java.util.logging.StreamHandler.publish(StreamHandler.java:194)
   @ java.util.logging.ConsoleHandler.publish(ConsoleHandler.java:95)
   @ java.util.logging.Logger.log(Logger.java:979)
   @ java.util.logging.Logger.doLog(Logger.java:1006)
   @ java.util.logging.Logger.log(Logger.java:1117)
   @ com.google.common.util.concurrent.AggregateFuture$RunningState.handleException(AggregateFuture.java:181)
   @ com.google.common.util.concurrent.AggregateFuture$RunningState.handleOneInputDone(AggregateFuture.java:222)
   @ com.google.common.util.concurrent.AggregateFuture$RunningState.access$200(AggregateFuture.java:78)
   @ com.google.common.util.concurrent.AggregateFuture$RunningState$1.run(AggregateFuture.java:133)
   @ com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:435)
   @ com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:900)
   @ com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:811)
   @ com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:675)
   @ com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:113)
   @ com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58)
   @ com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75)
   @ java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
   @ java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
   @ java.lang.Thread.run(Thread.java:834)
"xxxxxx-16-thread-12" #442 blocked on java.util.logging.ConsoleHandler@574ef6ab owned by "service-storage-pool-thread-70" Id=323
   java.lang.Thread.State: BLOCKED
   @ java.util.logging.StreamHandler.publish(StreamHandler.java:194)
   @ java.util.logging.ConsoleHandler.publish(ConsoleHandler.java:95)
   @ java.util.logging.Logger.log(Logger.java:979)
   @ java.util.logging.Logger.doLog(Logger.java:1006)
   @ java.util.logging.Logger.log(Logger.java:1117)
   @ com.google.common.util.concurrent.AggregateFuture$RunningState.handleException(AggregateFuture.java:181)
   @ com.google.common.util.concurrent.AggregateFuture$RunningState.handleOneInputDone(AggregateFuture.java:222)
   @ com.google.common.util.concurrent.AggregateFuture$RunningState.access$200(AggregateFuture.java:78)
   @ com.google.common.util.concurrent.AggregateFuture$RunningState$1.run(AggregateFuture.java:133)
   @ com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:435)
   @ com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:900)
   @ com.google.common.util.concurrent.AbstractFuture.addListener(AbstractFuture.java:634)
   @ com.google.common.util.concurrent.AbstractFuture$TrustedFuture.addListener(AbstractFuture.java:98)
   @ com.google.common.util.concurrent.AggregateFuture$RunningState.init(AggregateFuture.java:128)
   @ com.google.common.util.concurrent.AggregateFuture$RunningState.access$100(AggregateFuture.java:78)
   @ com.google.common.util.concurrent.AggregateFuture.init(AggregateFuture.java:75)
   @ com.google.common.util.concurrent.CollectionFuture$ListFuture.<init>(CollectionFuture.java:93)
   @ com.google.common.util.concurrent.Futures.allAsList(Futures.java:774)
   @ ....
@cpovirk
Copy link
Member

cpovirk commented Mar 31, 2022

The main question is probably what is holding the lock. You might get more help on StackOverflow.

You might also be interested in #2134, which is about providing a way to disable logging. That thread includes a possible workaround.

@cpovirk cpovirk closed this as completed Mar 31, 2022
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

No branches or pull requests

2 participants