Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data race during query factory initialisation #136

Closed
3 tasks done
o1egl opened this issue Aug 18, 2019 · 0 comments · Fixed by #133
Closed
3 tasks done

Data race during query factory initialisation #136

o1egl opened this issue Aug 18, 2019 · 0 comments · Fixed by #133

Comments

@o1egl
Copy link
Contributor

o1egl commented Aug 18, 2019

Describe the bug
In my application I initialize goqu.Database during startup and provide it as dependency to my services. During running my integration tests I got data race in queryFactory() function. You can reproduce it by running the code below with turned on races detector.

To Reproduce

dbConn, err := sql.Open("postgres", connStr)
db := goqu.New("postgres", dbConn)
for i=0; i < 2; i++ {
    go func(){
        db.From("foo").ScanStruct(...)
        ...
    }()
}

Dialect:

  • postgres
  • mysql
  • sqlite3
@doug-martin doug-martin mentioned this issue Aug 22, 2019
doug-martin added a commit that referenced this issue Aug 22, 2019
* [FIXED] Data race during query factory initialization #133 and #136 - @o1egl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant