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

Breaking: Get rid of atomic cancellation and provide a replacement #1937

Merged
merged 46 commits into from Oct 12, 2020

Commits on Sep 16, 2020

  1. Configuration menu
    Copy the full SHA
    074ea3d View commit details
    Browse the repository at this point in the history
  2. Remove atomic cancellation support

    This is a problematic for Android when Main dispatcher is cancelled on destroyed activity.
    Atomic nature of channels is designed to prevent loss of elements,
    which is really not an issue for a typical application, but creates problem when used with channels.
    
    * Internal suspendAtomicCancellableCoroutine -> suspendCancellableCoroutine
    * Internal suspendAtomicCancellableCoroutineReusable -> suspendCancellableCoroutineReusable
    * Remove atomic cancellation from docs
    * Ensures that flowOn does not resume downstream after cancellation.
    * MODE_ATOMIC_DEFAULT renamed into MODE_ATOMIC
    * Introduced MODE_CANCELLABLE_REUSABLE to track suspendCancellableCoroutineReusable
    * Better documentation for MODE_XXX constants.
    * Added stress test for proper handling of MODE_CANCELLABLE_REUSABLE
      and fixed test for #1123 bug with job.join (working in MODE_CANCELLABLE) that was not
      properly failing in the absence of the proper code in CancellableContinuationImpl.getResult
    * Added test for Flow.combine that should be fixed
    * Support extended invokeOnCancellation contract
    * Introduced internal tryResumeAtomic
    
    Fixes #1265
    Fixes #1813
    Fixes #1915
    elizarov committed Sep 16, 2020
    Configuration menu
    Copy the full SHA
    e68cb3b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    46238a6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5281798 View commit details
    Browse the repository at this point in the history
  5. ~ onElementCancel docs

    elizarov committed Sep 16, 2020
    Configuration menu
    Copy the full SHA
    3228b92 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    340e411 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    5e1ecd8 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    25b7727 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f91919d View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2020

  1. Update kotlinx-coroutines-core/common/test/CancellableResumeTest.kt

    Co-authored-by: Louis CAD <louis.cognault@gmail.com>
    elizarov and LouisCAD committed Sep 17, 2020
    Configuration menu
    Copy the full SHA
    356c88c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    073c5f3 View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2020

  1. Configuration menu
    Copy the full SHA
    cbc2f8b View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2020

  1. ~ Fixed channel performance

    Removed extra CompletedContinuation allocations with channels send/receive
    elizarov committed Sep 24, 2020
    Configuration menu
    Copy the full SHA
    7fac3b7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d94759b View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2020

  1. Configuration menu
    Copy the full SHA
    d6986ef View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a2339f2 View commit details
    Browse the repository at this point in the history
  3. ~ Docs typos fixed

    elizarov committed Sep 29, 2020
    Configuration menu
    Copy the full SHA
    5d3cee9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    76792fa View commit details
    Browse the repository at this point in the history
  5. ~ Fixed refs to suspendAtomicCancellableCoroutineReusable in docs

    Changed to suspendCancellableCoroutineReusable
    elizarov committed Sep 29, 2020
    Configuration menu
    Copy the full SHA
    c6aba6c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    077b0e0 View commit details
    Browse the repository at this point in the history
  7. ~ onElementCancel -> onUndeliveredElement

    * Consistent type-alias use.
    * Rewrote docs to used "element delivery" concept.
    elizarov committed Sep 29, 2020
    Configuration menu
    Copy the full SHA
    9cfcb11 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    e9c6ee3 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    4674989 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    9b8778e View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    aa926fa View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    7fe569f View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    38ec1d0 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    a2ed60f View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    08ce2f8 View commit details
    Browse the repository at this point in the history
  16. ~ Call onUndeliveredElement when channel is closed/cancelled

    Also more docs and example for onUndeliveredElement usage
    elizarov committed Sep 29, 2020
    Configuration menu
    Copy the full SHA
    c6a07b2 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    afe8cc3 View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2020

  1. Configuration menu
    Copy the full SHA
    427117d View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2020

  1. Update kotlinx-coroutines-core/common/src/channels/AbstractChannel.kt

    Co-authored-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
    elizarov and qwwdfsad committed Oct 5, 2020
    Configuration menu
    Copy the full SHA
    b30d099 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    85b7812 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6535659 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    500c911 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2893470 View commit details
    Browse the repository at this point in the history
  6. Update kotlinx-coroutines-core/common/src/internal/DispatchedTask.kt

    Co-authored-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
    elizarov and qwwdfsad committed Oct 5, 2020
    Configuration menu
    Copy the full SHA
    4760c22 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    6b79de8 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    c88b832 View commit details
    Browse the repository at this point in the history
  9. ~ Fixed bug in ChannelUndeliveredElementStressTest

    * It must drain the channel before trying to verify.
    * A detailed analysis on failure is printed.
    elizarov committed Oct 5, 2020
    Configuration menu
    Copy the full SHA
    4a7eb7a View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2020

  1. ~ Initialize DispatchedContinuation.resumeMode with MODE_UNINITIALIZED

    This makes code cleaner, highlighting the fact that the actual resumeMode is always set when the continuation is being resumed.
    + added explicit test to ensure that a regular suspendCoroutine from stdlib resumes atomically and ignores cancellation.
    elizarov committed Oct 6, 2020
    Configuration menu
    Copy the full SHA
    5bca7ca View commit details
    Browse the repository at this point in the history
  2. ~ CancellableContinuationImpl.resetState -> resetStateReusable

    Also, assert mode is MODE_CANCELLABLE_REUSABLE, don't update it.
    elizarov committed Oct 6, 2020
    Configuration menu
    Copy the full SHA
    12bba52 View commit details
    Browse the repository at this point in the history
  3. ~ More tests on double invokeOnCancellation calls

    Removed old TODO
    elizarov committed Oct 6, 2020
    Configuration menu
    Copy the full SHA
    3df38e9 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2020

  1. 1 Configuration menu
    Copy the full SHA
    164d3e5 View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2020

  1. ~ JvmField Itr.channel

    elizarov committed Oct 12, 2020
    Configuration menu
    Copy the full SHA
    4361158 View commit details
    Browse the repository at this point in the history