-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Something like Deadlock #331
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
Comments
So you have to use regular multi-thread programming with blocking function or suspending function in non-blocking mode. If you want to try the non-blocking mode take a look to Spring Reactor integration. |
@lymychm Remove
|
Thank you for the answers. So this simple example(using String REST Controllers):
my bottleneck will be same with this example https://habrahabr.ru/post/346004/, we should not use coroutines in that way? |
Hi @lymychm , |
Hi @fvasco , |
You cannot invoke blocking code, consider
and change the function |
you mean that if I want to invoke some function/method inside |
|
I see, |
Hi, so when I'm set
to >= 6
I'm getting something like deadlock,End
line is never printed, whento <= 5
everything works finecoroutines version = 0.22.5
kotlin.version=1.2.31
jdk1.8.0_162
my cpu has 8 cores
my real problem is that I having REST service(on spring boot) where i'm getting data from DB in 2 async lines and in the end I'm calling
await()
val firstData = async { firstService.getDataFromDb(someId) }
val secondData = async { secondService.getDataFromDb(someId)}
Result(firstData.await(), secondData.await())
and after some period from 10-30 mins(spring-boot jar working), all services in my REST api freezes, and nothing in log file, same as in this small example(but in this example I'm getting freeze every time when
to >=6
)I assuming that I'm using coroutines in wrong way(maybe).
I would be glad of any help
The text was updated successfully, but these errors were encountered: