-
Notifications
You must be signed in to change notification settings - Fork 70
Fix Postgres post_user Infinite Recursion #1876
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
Conversation
55f3a27 to
6e057fc
Compare
6e057fc to
d5de9b1
Compare
| } | ||
|
|
||
| /// Method to create a new user, given a `PostUser` struct containing data regarding the user. | ||
| #[cfg(debug_assertions)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@taddes Why did we have this flag here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a conditional compilation attribute, which tells the compiler to only include the annotated code when compiling in debug mode (debug_assertions). This was for testing purposes and matched the interface for MySQL, but it looks like it might have needed to be annotated the impl Db for TokenserverPgDb . There is a mix of cases where some are annotated with #[cfg(debug_assertions)] at the interface definition at the bottom, and some when the traits are actually implemented. I don't know why it's one of the few methods in both postgres and mysql to not have that annotation. Needless to say, I'm sorry if that's the goose you've been chasing and that was seemingly enough to break the test run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was for testing purposes and matched the interface for MySQL, but it looks like it might have needed to be annotated the impl Db for TokenserverPgDb .
Why don't we want the actual impl in the release build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question, this applies to a lot of them and existing ones in MySQL. Let's tag @pjenvey
taddes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
The
postgres-e2e-testsjob was failing in CircleCI due to a stack overflow error. The problem was thatTokenserverPgDb::post_userhad#[cfg(debug_assertions)]thus was not in the release build against which the integration tests were executed, resulting in an infinite recursion in the Db train impl ofpost_user.Closes STOR-397 / #1869