Skip to content

reset session identity during pool cleanup - #1587

Open
murex971 wants to merge 1 commit into
mainfrom
session-role-cleanup
Open

murex971 wants to merge 1 commit into
mainfrom
session-role-cleanup

Conversation

@murex971

@murex971 murex971 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

RESET ALL does not reset role or session_authorization.
Run SET SESSION AUTHORIZATION DEFAULT before the existing dirty cleanup. This
restores the authenticated user and clears any active role, covering both
SET ROLE and SET SESSION AUTHORIZATION.

closes: #1341

@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

.unwrap();
assert_eq!(identity(&mut guard).await, ("pgdog".into(), role.clone()));

guard.mark_dirty(true);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think to resolve the original issue you want to make sure we detect the role change automatically and reset it back. This test artificially creates that condition.

I think we need to adjust the query parser set handler to detect SET ROLE and mark the server as dirty for cleanup.

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.

Transaction pooling leaks SET ROLE between connections

2 participants