Say I have an @Async method call that hangs. Will it time out? What is best practise here to free you resources?
Say I have an @Async method call that hangs. Will it time out? What
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
@Asyncmethod invocations are executed within a specified thread pool. If your method hangs, it will hold one thread from the pool infinitely. Spring can’t do anything about it.If your method is kind enough to accept
InterruptedException, you can cancel it by callingFuture.cancel()on a value returned from asynchronous method.