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

Duplicate Prepared Statement with Thread#kill #26588

Closed
schneems opened this issue Sep 22, 2016 · 2 comments
Closed

Duplicate Prepared Statement with Thread#kill #26588

schneems opened this issue Sep 22, 2016 · 2 comments

Comments

@schneems
Copy link
Member

As seen in this stack overflow post http://stackoverflow.com/a/31167112/147390 there is a race condition where a prepared statement in the DB, however the thread that created it is killed before Rails can record the successful statement.

I did some grepping and couldn't find this as an issue on Rails, so I wanted to raise it here. I don't know if there's a good work around, the post mentions using a GUID instead of an integer, that could work, or maybe adding retry logic to prepared statement creation so that it records a495 (or whatever number` is already taken and uses the next in the series.

@matthewd
Copy link
Member

See #17607, and more recently #25827

@schneems
Copy link
Member Author

Thanks!

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

No branches or pull requests

2 participants