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

Set default busy timeout to 5 seconds #929

Closed
wants to merge 2 commits into from

Conversation

king6cong
Copy link
Contributor

similar to:
jgallagher/rusqlite@05b03ae

this should reduce SQLITE_BUSY situation

similar to:
jgallagher/rusqlite@05b03ae

this should reduce SQLITE_BUSY situation
@killercup
Copy link
Member

killercup commented Jun 2, 2017 via email

@king6cong
Copy link
Contributor Author

king6cong commented Jun 2, 2017

yeah, this deals with multiple concurrent sqlite writers.

there are some discussions like here:

mattn/go-sqlite3#274

and also these documentations:

tldr:

  • SQLITE_BUSY will occur inevitably when there are multiple thread writers and we need to handle this
  • add busy timeout will reduce the SQLITE_BUSY situation
  • at the moment, diesel will panic in step when SQLITE_BUSY occurred, I think log it maybe better for users at the moment. Better error handling should be saved for another commit :)

reference: https://github.com/jgallagher/rusqlite/blob/master/src/row.rs#L43

@sgrif
Copy link
Member

sgrif commented Jun 3, 2017

I'd rather not introduce the log crate or warnings for this. We need to properly return an error here.

this commit only logs the error, but can more refine grained
method should be used.

reference: https://github.com/jgallagher/rusqlite/blob/master/src/row.rs#L43
@king6cong
Copy link
Contributor Author

king6cong commented Jun 4, 2017

Updated :)

@king6cong
Copy link
Contributor Author

king6cong commented Jun 14, 2017

@sgrif @killercup These changes turn out working well in our project, any ideas?

@sgrif
Copy link
Member

sgrif commented Jun 18, 2017

We need to properly return an error here.

We cannot accept a PR that simply has TODO: Better error handling

@sgrif
Copy link
Member

sgrif commented Jul 17, 2017

Going to close this, as it's been sitting around for a while. Feel free to re-submit if you're still interested in working on this. However for this to be accepted we'd need to present this error case to the user. Silently treating it as an empty result set is not an acceptable solution.

@sgrif sgrif closed this Jul 17, 2017
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 this pull request may close these issues.

3 participants