You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 26, 2021. It is now read-only.
Was experiencing some occasional, random array index out of bounds exceptions from circular dependency check in graph validation and looking at the code it occurs to me that the code for circular dependency checking is not thread safe. It sets a visiting flag on the binding to mark that it is currently visiting it. But if another thread happens to be validating the same graph this can lead to problems. If a binding is visited on another thread the current thread will see the binding as visited. When it tries to compose a nice message of the cycle it starts at the index of the binding in its path, but the current path has not actually visited it so does not have that binding in its path thus the Array index out of bounds exception.
In our case the multiple threads was due to the fact that we use Dagger to also inject some services and it was always the injection for a service that failed. If they happened to be started at the same time as an injection for the UI we get the exception.