aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-05-10Version 1.8.1upstream-masterDmitry Khalanskiy
2024-04-25Fix the ticker channel example giving wrong results on the website (#4109)Dmitry Khalanskiy
https://play.kotlinlang.org/ of the example that's being changed here is currently unreliable: the last line is occasionally `null`. By increasing all time intervals twofold, we reduce the impact of the CPU scheduling in the constrained environment. With this change, the results are consistent across dozens of runs: <https://pl.kotl.in/uCa-60j43> Originally reported by `@PetrakovichVictoria`
2024-04-25Fix broken API reference links to the Project Reactor Javadoc (#4111)Dmitry Khalanskiy
See <https://github.com/reactor/reactor-core/issues/3794>
2024-04-22fix the link to `Thread.uncaughtExceptionHandler`Victoria Petrakovich
2024-04-16fix: get rid of horizontal scrolling by splitting the comment and show more ↵Victoria Petrakovich
code mentioned (#4100)
2024-04-11Fix typo in coroutine-context-and-dispatchers.md (#3941)Johnny Lim
2024-04-03fix: remove `sampleStart` and `sampleEnd` comments from example in ↵Victoria Petrakovich
coroutine-context-and-dispatchers.md (#4081)
2024-04-03chore: fix identation in example loadContributorsBlocking() (#4085)Victoria Petrakovich
2024-04-03Docs: reference to The Hitchhiker's Guide to the Galaxy (#4082)Victoria Petrakovich
At the end of the book, they multiply 6 * 7 :)
2024-04-03Docs: avoid scrolling sample code; fix test description; add () to functions ↵Victoria Petrakovich
calls (#4080)
2024-03-28Update Dokka to 1.9.20 (#4057)Oleg Yukhnevich
2024-03-25Fix `Flow.timeout` swallowing the channel closure exception (#4072)Dmitry Khalanskiy
Fixes #4071
2024-03-11Version 1.8.1-BetaDmitry Khalanskiy
2024-03-11Ensure that inline functions only access atomics from the same class (#4041)mvicsokolova
Calling a function containing atomic operations from a different file results in the failure of Native incremental compilation. Made BufferedChannel#sendImpl function private. This is a WA for KT-65554
2024-03-08Potential workaround for #3820 (#4054)Vsevolod Tolstopyatov
Replace the specific place where ARFU gets misexecuted by a specific Android toolchain Fixes #3820
2024-03-01Bump Kover version to `0.8.0-Beta` (#4055)Sergey Shanshin
2024-02-27Reduce the overall time spent on stress tests in stress mode (#3890)Vsevolod Tolstopyatov
* Reduce the number of time spent on lincheck tests in stress mode to be aligned with our stress test multiplier (25) instead of x100 * Reduce the number of iterations and time spent in [nowadays] less relevant tests Rationale: these contribute to more than an hour of stress tests time spent
2024-02-27Rework CompletionHandler to avoid subclassing a functional type (#4010)Dmitry Khalanskiy
Workaround for KT-64075 Also, thoroughly document the contracts imposed on the callbacks provided to `invokeOnCompletion` and `invokeOnCancellation`.
2024-02-26Fix a bug that could leave the coroutine scheduler's PRNG in an invalid ↵Simon Ogorodnik
state (#4052) A potential bug is fixed, where `nextInt` would always return zero due to incorrect initialization of rngState with zero. This could happen during the creation of a worker with thread id = `1595972770` (JDK >=8), or unpredictable if fallback thread-local random is used (android SDK <34 or JDK <7), approximate probability is 2.4E-10 Also, this slightly optimizes the performance of coroutines initialization. During the creation of `CoroutineScheduler.Worker`, we need to initialize its embedded random number generator. To avoid additional class-loading costs (#4051), `rngState` is now directly initialized from the current nanoTime (that is used as seed). Fixes #4051 Co-authored-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
2024-02-26Remove outdated ExperimentalTime annotation (#4046)Philip Wedemann
2024-02-15Merge pull request #4044 from Kotlin/masterDmitry Khalanskiy
Merge `develop` with `master`
2024-02-15Version 1.8.0Dmitry Khalanskiy
2024-02-15Disable DebugProbes.enableCreationStackTraces by default (#4028)Vsevolod Tolstopyatov
Adjust tests and the documentation Rationale: this option implies significant and non-trivial overhead, yet its utility is unclear (e.g., we got a multitude of signals that this option brings no use and none that it's useful even when asked explicitly) Fixes #3783
2024-02-15Merge pull request #4042 from Kotlin/dk-doc-improvementsDmitry Khalanskiy
Small documentation fixes
2024-02-15Supply MDC context propagation with examples.Dmitry Khalanskiy
Fixes #3280
2024-02-15Revisit SupervisorScope, supervisorScope, and coroutineScope docsDmitry Khalanskiy
Seems like a lot of the information was outdated. Fixes #3725
2024-02-15Don't say that job completion causes `CancellationException`Dmitry Khalanskiy
What does it even mean?
2024-02-15Reword the prompt cancellation guaranteeDmitry Khalanskiy
Emphasize the fact that the function fails to resume *even if it already completed* but wasn't dispatched yet. Before the change, when translating the documentation to Chinese, there could be a confusion as to what "it will not resume successfully" means. Fixes #3888
2024-02-15Improve the explanation of how `await` throws exceptionsDmitry Khalanskiy
Fixes two issues: * It is surprising for some users that the same exception can be thrown several times. Clarified this point explicitly. * Due to #3658, `await` can throw `CancellationException` in several cases: when the `await` call is cancelled, or when the `Deferred` is cancelled. This is clarified with an example of how to handle this. Fixes #3937
2024-02-15Clarify that using `runBlocking` in `suspend` functions is allowedDmitry Khalanskiy
A user raised a concern that the internal coroutines machinery may break if `runBlocking` is used somewhere deeply in the call stack. Calling `runBlocking` from a `suspend` functions can lead to deadlocks naturally due to blocking the thread, or to surprising event ordering, but nothing is expected to break. This commit clarifies the exact danger of calling `runBlocking` from `suspend` functions.
2024-02-15Ensure that flow operators propagate the cancellation exceptions (#4038)Dmitry Khalanskiy
Before this change, it could happen that some size-limiting operators upstream swallowed the requests to limit the flow size emitted by the operators downstream. This could cause `onCompletion` calls between these operators to incorrectly report that the flow was not in fact limited by the downstream operators. Additionally, in the presence of additional size-limiting operators in the chain, `first` and `single` and their variants could exhibit incorrect behavior where emitting a value from `onCompletion` would overwrite their output. Fixes #4035
2024-02-07Fix a build error on nightly compiler version (#4032)Dmitry Khalanskiy
With the newer Kotlin Gradle plugin, we got this error: 'var compilations: NamedDomainObjectContainer<KotlinJvmCompilation>' can't be called in this context by implicit receiver. Use the explicit one if necessary With this change, we use an explicit receiver, as instructed.
2024-01-30Use dashes instead of asterisks for lists in KDoc (#4027)Dmitry Khalanskiy
* Replace `*` with `-` everywhere in KDoc git grep -l '\* \+\* ' | xargs -n1 sed -i 's/^\([ \t]*\* \+\)\* /\1- /' * Fix several false positives of the regex replacement
2024-01-30Replace the rest of Gradle scripts with gradle.kts, extract test utilities ↵Dmitry Khalanskiy
to a separate module (#4011)
2024-01-30Separate test facilities into a separate module and clean upDmitry Khalanskiy
Move the test facilities lying around `kotlinx-coroutines-core` and their reimplementation in `kotlinx-coroutines-test` into a separate module, on which the other modules now depend. This allows us to have internal testing facilities in common code. After the migration, the test facilities were also refactored a bit: * Removed many SUPPRESS directives, * Extracted a lot of code to multiplatform, * Fixed a couple of bugs in TestBase, * etc. Finally, the tests were cleaned up automatically a bit, most notably by replacing `assertTrue(a is T)` with `assertIs`.
2024-01-30Perform a major cleanup of Gradle scripts after the translationDmitry Khalanskiy
* Remove the workarounds for IDEA import from gradle.kts Without the workarounds, everything still seems to be working fine, even after invalidating the caches. * Clarify the opt-ins. Unify the handling of all opt-ins in the project, and also add opt-ins for Native that would be widespread otherwise. Unfortunately, even after that, the IDE still complains about not having the right opt-in in kotlinx-coroutines-test/common/test/Helpers.kt. * Extract the logic of grouping several source sets into a single shared one. * Update the kotlinx-coroutines-core build script: - Utilize the multiplatform hierarchy to avoid defining extra source sets. - Reorder the code for readability. * Fix the IDE failing to find `actual` implementations for jvmCore by making sure `jvmCoreMain` is only defined when the IDE is not active. Without a dependency from jvmCoreMain to jvmMain, `expect` declarations in the IDE complained that they couldn't find `actual` in the `jvmCore` source-set. For example, this could be seen in kotlinx-coroutines-core/common/src/internal/Concurrent.common.kt. * Fix passing the stressTest system property to tests Broken in #3966 * kotlinOptions -> compilerOptions
2024-01-29Translate *.gradle to *.gradle.ktsDmitry Khalanskiy
2024-01-29Move *.gradle to *.gradle.ktsDmitry Khalanskiy
This commit intentionally won't build. It's introduced to preserve history, so that Git tooling understands the line of succession between the old and new files.
2024-01-29Re-structure DebugProbes documentation and mention classloading (#4024)Vsevolod Tolstopyatov
* Re-structure DebugProbes documentation and mention classloading Fixes #4000 Co-authored-by: Dmitry Khalanskiy <52952525+dkhalanskyjb@users.noreply.github.com>
2024-01-25Update the copyright notices to the new requirements (#4016)Dmitry Khalanskiy
* Remove copyright notices from individual files; * Update the NOTICE file to include the year of initial publication and the year of the latest change; * Remove the IDEA template for adding notices to every file. This is in accordance with https://youtrack.jetbrains.com/articles/MKT-A-236159528/, using the clarifications from https://youtrack.jetbrains.com/issue/LegalCZ-6871
2024-01-23Merge pull request #4020 from Kotlin/bobova/fix-type-inferenceMargarita Bobova
Fix "Type mismatch: inferred type is String? but String was expected"
2024-01-23Do not fail on nullable YarnRootExtension fields in GradleMargarita Bobova
2024-01-16Get rid of native-mt leftovers (#4013)Vsevolod Tolstopyatov
Notably, an artificial entry point Fixes #4009
2024-01-15Simplify internal handling of suppressed exceptions (#4007)Dmitry Khalanskiy
2023-12-21Merge pull request #3999 from Kotlin/new_developDmitry Khalanskiy
Update the development branch after a release
2023-12-21Version 1.8.0-RC2Dmitry Khalanskiy
2023-12-21Merge remote-tracking branch 'origin/master' into developDmitry Khalanskiy
2023-12-21Work around #3968, start running integration tests for Native (#3996)Dmitry Khalanskiy
As there were no native targets in smokeTest, the problem with the missing atomicfu dependency (KT-64111) was not addressed in time. The bug was revealed after release of kotlinx.coroutines with atomicfu-gradle-plugin 0.23.1. Coroutines enabled Native IR transformation, and for this mode, atomicfu-gradle-plugin only provided compile dependency to atomicfu, though implementation dependency was still necessary. This commit adds the smoke test for Native and temporarily adds an explicit dependency on atomicfu for Native artifacts. Fixes #3968 Co-authored-by: Maria Sokolova <maria.sokolova@jetbrains.com>
2023-12-21Document newFixedThreadPoolContext in common code (#3994)Dmitry Khalanskiy
Fixes #3993
2023-12-21Fix a compilation error due to deprecations (#3995)Dmitry Khalanskiy