Skip to content
This repository has been archived by the owner on May 20, 2019. It is now read-only.

Data Race Mentor Section Sign Up #36

Open
mikeaboody opened this issue Aug 26, 2016 · 1 comment
Open

Data Race Mentor Section Sign Up #36

mikeaboody opened this issue Aug 26, 2016 · 1 comment
Assignees
Labels

Comments

@mikeaboody
Copy link
Contributor

assignMentor (line 114 in app/models/section.rb) does not take into account race conditions. It is possible that two thread simultaneously pass check on line 115 but then both get assigned to the section via lines 118-121. Big issue in all of this: I don't know how to lock an object in ruby on rails when that object is created via the database. Perhaps we can lock the db row for that section via http://api.rubyonrails.org/classes/ActiveRecord/Locking/Pessimistic.html.

@mikeaboody
Copy link
Contributor Author

http://thelazylog.com/understanding-locking-in-rails-activerecord/ look into optimistic locking here actually.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants