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

Fix race condition in scope resolveInstance #1465

Merged
merged 2 commits into from Nov 14, 2022

Commits on Nov 2, 2022

  1. Fix an issue where concurrent calls to koin.get would create a race c…

    …ondition resulting in this stack trace:
    
    Fatal Exception: java.util.NoSuchElementException
    ArrayDeque is empty.
    kotlin.collections.ArrayDeque.removeFirst (ArrayDeque.kt:145)
    kotlin.collections.ArrayDeque.removeFirstOrNull (ArrayDeque.java:157)
    org.koin.core.scope.Scope.resolveInstance (Scope.kt:244)
    org.koin.core.scope.Scope.get (Scope.kt:204)
    org.koin.core.scope.Scope.getOrNull (Scope.kt:172)
    
    ArrayDeque is not a thread-safe collection, by wrapping calls to parameterStack in a synchronized block it makes sure the race condition cannot happen.
    
    This fixes InsertKoinIO#1149
    npresseault committed Nov 2, 2022
    Copy the full SHA
    b2efb22 View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2022

  1. Cosmetic changes

    npresseault committed Nov 3, 2022
    Copy the full SHA
    9f5ef3f View commit details
    Browse the repository at this point in the history