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

Remove DCSS #4053

Merged
merged 13 commits into from May 21, 2024
Merged

Remove DCSS #4053

merged 13 commits into from May 21, 2024

Commits on Apr 23, 2024

  1. Remove DCSS

    dkhalanskyjb committed Apr 23, 2024
    Configuration menu
    Copy the full SHA
    ea913b0 View commit details
    Browse the repository at this point in the history
  2. Extract child-handling logic into another function

    This change is mostly a refactoring, except now, an arbitrary
    `onCancelling` handler that's not a child will not add itself in
    a `synchronized` block. Instead, only the root cause is read under
    a lock.
    dkhalanskyjb committed Apr 23, 2024
    Configuration menu
    Copy the full SHA
    a69748c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8a76e31 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ef43ce5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    85c45a0 View commit details
    Browse the repository at this point in the history
  6. Fix a spinlock in invokeOnCompletion with onCancelling = true

    Before this change, when children were prohibited from adding
    themselves to the list, cancellation handlers were also prohibited
    from doing so. This was plain incorrect, because a list that's
    closed for new children could still get cancelled later, and also
    because being closed for new children happened before advancing the
    state to the final one.
    dkhalanskyjb committed Apr 23, 2024
    Configuration menu
    Copy the full SHA
    815db36 View commit details
    Browse the repository at this point in the history
  7. Improve the docs

    dkhalanskyjb committed Apr 23, 2024
    Configuration menu
    Copy the full SHA
    970da72 View commit details
    Browse the repository at this point in the history
  8. Remove some unnecessary synchronized blocks

    `rootCause` is atomic anyway.
    dkhalanskyjb committed Apr 23, 2024
    Configuration menu
    Copy the full SHA
    0c52fe8 View commit details
    Browse the repository at this point in the history
  9. Fix a newcoming child being sometimes ignored

    The failure went like this:
    * A child arrives.
    * In the meantime, the parent enters `tryMakeCompletingSlowPath`
      and remembers the current list of handlers, which is an empty
      or a single-element one.
    * The parent updates the state to the finishing one.
    * The child enters the list.
    * The parent traverses *an old list*, the one from before the
      child arrived. It sees no children in the empty/single-element
      list and forgets about the child.
    
    Why, then, was it that this worked before?
    
    It was because there was a guarantee that no new children are going
    to be registered if three conditions are true:
    * The state of the `JobSupport` is a list,
    * The root cause of the error is set to something,
    * And the state is already "completing".
    
    `tryMakeCompletingSlowPath` sets the state to completing, and
    because it updates the state inside `synchronized`, there was a
    guarantee that the child would see either the old state (and, if
    it adds itself successfully, then `tryMakeCompletingSlowPath` will
    retry) or the complete new one, with `isCompleting` and the error
    set to something.
    
    So, there could be no case when a child entered a *list*, but this
    list was something different from what `tryMakeCompletingSlowPath`
    stores in its state.
    dkhalanskyjb committed Apr 23, 2024
    Configuration menu
    Copy the full SHA
    d989e06 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    494d8ca View commit details
    Browse the repository at this point in the history

Commits on May 8, 2024

  1. Update kotlinx-coroutines-core/concurrent/src/internal/LockFreeLinked…

    …List.kt
    
    Co-authored-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
    dkhalanskyjb and qwwdfsad committed May 8, 2024
    Configuration menu
    Copy the full SHA
    855ec80 View commit details
    Browse the repository at this point in the history

Commits on May 10, 2024

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

Commits on May 13, 2024

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