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

JAMES-2586 PostgresExecutor: Retry upon PreparedStatement conflicts #1840

Conversation

quantranhong1999
Copy link
Contributor

resolve linagora#4950

…dSafetyTest

We do not control directly r2dbc-postgresql Connection but library owner, thus we can do nothing upon tests failure.
But we can handle library failure at James layer using PostgresExecutor wrapper.
PreparedStatement id is unique per PG connection.
We share a PG connection across multi threads leads to PreparedStatement id conflicts.
We can retry upon PreparedStatement id conflicts.
…ct exception

io.r2dbc.postgresql.ExceptionFactory$PostgresqlBadGrammarException: [42P05] prepared statement "S_0" already exists

Should not retry upon other fatal exception e.g. database failure, invalid authorization...
@quantranhong1999 quantranhong1999 force-pushed the postgres-retry-upon-prepare-statement-conflict branch from 3daff12 to 049e980 Compare December 5, 2023 06:08
@chibenwa chibenwa merged commit 9081a2f into apache:postgresql Dec 5, 2023
1 check passed
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