-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Problem with delay with kotlinx-coroutines-javafx #3106
Labels
Comments
This bug caused our tests to get stuck only on Jenkins! We just needed to add this line to our
|
qwwdfsad
added a commit
that referenced
this issue
Jan 11, 2022
The approach from 1.6.0 has proven itself as unstable and multiple hard-to-understand bugs have been reported: * JavaFx timer doesn't really work outside the main thread * The frequent initialization pattern "runBlocking { doSomethingThatMayCallDelay() }" used on the main thread during startup now silently deadlocks * The latter issue was reported both by Android and internal JB Compose users * The provided workaround with system property completely switches off the desired behaviour that e.g. Compose may rely on, potentially introducing new sources of invalid behaviour The original benefits does not outweigh these pitfalls, so the decision is to revert this changes in the minor release Fixes #3113 Fixes #3106
yorickhenning
pushed a commit
to yorickhenning/kotlinx.coroutines
that referenced
this issue
Jan 28, 2022
…tlin#3131) The approach from 1.6.0 has proven itself as unstable and multiple hard-to-understand bugs have been reported: * JavaFx timer doesn't really work outside the main thread * The frequent initialization pattern "runBlocking { doSomethingThatMayCallDelay() }" used on the main thread during startup now silently deadlocks * The latter issue was reported both by Android and internal JB Compose users * The provided workaround with system property completely switches off the desired behaviour that e.g. Compose may rely on, potentially introducing new sources of invalid behaviour The original benefits does not outweigh these pitfalls, so the decision is to revert this changes in the minor release Fixes Kotlin#3113 Fixes Kotlin#3106
dee-tree
pushed a commit
to dee-tree/kotlinx.coroutines
that referenced
this issue
Jul 21, 2022
…tlin#3131) The approach from 1.6.0 has proven itself as unstable and multiple hard-to-understand bugs have been reported: * JavaFx timer doesn't really work outside the main thread * The frequent initialization pattern "runBlocking { doSomethingThatMayCallDelay() }" used on the main thread during startup now silently deadlocks * The latter issue was reported both by Android and internal JB Compose users * The provided workaround with system property completely switches off the desired behaviour that e.g. Compose may rely on, potentially introducing new sources of invalid behaviour The original benefits does not outweigh these pitfalls, so the decision is to revert this changes in the minor release Fixes Kotlin#3113 Fixes Kotlin#3106
pablobaxter
pushed a commit
to pablobaxter/kotlinx.coroutines
that referenced
this issue
Sep 14, 2022
…tlin#3131) The approach from 1.6.0 has proven itself as unstable and multiple hard-to-understand bugs have been reported: * JavaFx timer doesn't really work outside the main thread * The frequent initialization pattern "runBlocking { doSomethingThatMayCallDelay() }" used on the main thread during startup now silently deadlocks * The latter issue was reported both by Android and internal JB Compose users * The provided workaround with system property completely switches off the desired behaviour that e.g. Compose may rely on, potentially introducing new sources of invalid behaviour The original benefits does not outweigh these pitfalls, so the decision is to revert this changes in the minor release Fixes Kotlin#3113 Fixes Kotlin#3106
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
versions:
smallest example of bug
BUG: Some jobs stay blocked forever in
delay
function.I've been trying to figure out what the problem is. And it is because the delay is redirected to
kotlinx.coroutines.javafx.JavaFxDispatcher#schedule
, where the delay is implemented as aTimeLine
for JavaFx. However, this Timeline is started outside of theJavaFX Thread
and this will lead to unexpected results.Workarounds:
withContext(Dispatchers.Main) { delay(100) }
- Dispatchers.Main is JavaFx thread in this case.kotlinx.coroutines.main.delay=false
- switch off redirecting to JavaFxDispatcher (Dispatchers.Main)kotlinx-coroutines-javafx
dependency (not possible for me)The text was updated successfully, but these errors were encountered: