Proposal: remove side-effects of Eager
#723
Labels
f: associations
the associations feature in pop
s: triage
Some tests need to be run to confirm the issue
Milestone
Description
I am getting some reports from
go test -race
when using parallel tests:When looking a bit into the code, I was actually surprised to see that
Eager
is implemented as a side-effect of the connection and query, although it is reset after each execution. Is there a specific reason for this? Using side-effects here makes it impossible to use connections and queries concurrently.I know there are other problems with concurrency, namely with the mysql driver #530. I also found related API problems with how eager is currently implemented #307
In my opinion, we should either
Side-effects are always a problem with concurrency, so refactoring eager mode to not use side-effects is probably the best way to go.
Steps to Reproduce the Problem
Call
c.Create
in multiple parallel go routines.Expected Behavior
Create multiple models concurrently.
Actual Behavior
Race-condition as eager uses side-effects.
The text was updated successfully, but these errors were encountered: