Skip to content

Conversation

@chenba
Copy link
Collaborator

@chenba chenba commented Oct 31, 2025

The postgres-e2e-tests job was failing in CircleCI due to a stack overflow error. The problem was that TokenserverPgDb::post_user had #[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 of post_user.

Closes STOR-397 / #1869

@chenba chenba force-pushed the chore/integration-tests-stack-overflow-STOR-397 branch 8 times, most recently from 55f3a27 to 6e057fc Compare November 3, 2025 19:44
@chenba chenba force-pushed the chore/integration-tests-stack-overflow-STOR-397 branch from 6e057fc to d5de9b1 Compare November 3, 2025 20:26
@chenba chenba marked this pull request as ready for review November 3, 2025 20:31
@chenba chenba changed the title [CI][DRAFT] tokenserver integration tests on postgres debugging Fix Postgres post_user Infinite Recursion Nov 3, 2025
}

/// Method to create a new user, given a `PostUser` struct containing data regarding the user.
#[cfg(debug_assertions)]
Copy link
Collaborator Author

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?

Copy link
Collaborator

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.

Copy link
Collaborator Author

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?

Copy link
Collaborator

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

Copy link
Collaborator

@taddes taddes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@chenba chenba merged commit 594f1de into master Nov 3, 2025
14 checks passed
@chenba chenba deleted the chore/integration-tests-stack-overflow-STOR-397 branch November 3, 2025 21:17
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