Hi there! I think I just found a concurrency issue...
# koin
s
Hi there! I think I just found a concurrency issue in Koin. After a few weeks hunting a crash we were having in production, I found out that Koin was sometimes creating more than one instance of a dependency declared as
single
. I've isolated the issue to a concurrency bug in
SingleInstanceFactory
. I have an (ugly) test reproducing it, and a possible solution. It's tricky because the probability of happening is very low, but it happens ^^' @arnaud.giuliani would you like me to open a PR? Or do you prefer to discuss it here before?
a
open PR & propose test to reproduce it, sure 👍
let’s continue to talk also here
s
ok, great! I'll try to do that tomorrow morning 🙂
a
sure, thanks
s
Here you go! I tried to explain everything the best I could https://github.com/InsertKoinIO/koin/pull/914
a
yep, when you talked about that yesteray, I was looking at the double check and the
get
part effectively
answered, we can remove synchronized from create part then
s
cool! I wasn't sure if
create
is used for anything else. I'll remove it 🙂
a
yes,
create
is just used by
get
🙂
thanks
s
glad I could help!
👍 1
👏 1