assaf / vanity

Experiment Driven Development for Ruby
http://vanity.labnotes.org
MIT License
1.55k stars 269 forks source link

Prevent dupe participation in same experiment #336

Closed pihman closed 6 years ago

pihman commented 6 years ago

Fixes a race condition that leads to multiple participant records for the same experiment/identity. This could even lead to users w/ participation records in two different segments!!!

Thread A: ab_test(:my_experiment) => seen=0 Thread B: ab_test(:my_experiment) => seen=1

Solution:

pihman commented 6 years ago

dupe PR