-
Notifications
You must be signed in to change notification settings - Fork 184
Connection in unstable state when rollback after a failed commit #274
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
Comments
I don't think that r2dbc-postgres really does some tx-management. As I can see in log all this rolling-back-failed-to-commit-tx logic is in |
What @Squiry said. I'm worried about the
I need to look into it what's going on. |
I have only a partial explanation on what happens. For some reason, the We require a reproducer to further investigate what's happening. |
I'm trying to reproduce the issue on a sample, but without success. |
FluxDiscardOnCancel gets activated if you cancel the result consumption before consuming all results from the statement execution. You should be able to reproduce it via statement.execute().flatMap(result -> result.map(...)).take(1) assuming that the statement creates more than one row. |
Hi, I created a project to reproduce the issue: https://github.com/deblockt/r2dbc-issue-reproducer I doesn't have the same log, but I have the same issue finally (a closed connecton) |
It seem that with |
I have test on my real case application, Have the issue change using |
0.8.3 ships with mostly dependency upgrades and smaller improvements and there aren't really bugfixes. Let me have a look at the provided sample. |
I was able to get all sorts of exceptions with version 0.8.1 (Arabba-SR2). Version 0.8.2 contained some significant changes to cancellation and event dispatching so I expect 0.8.2 is really the version that fixed a few things. Let me know if the issue persists or has changed so that we can either continue the investigation or that we can close this ticket. |
With the last version when an error occurs, the rollback start, but the mono is never completed. |
We fixed today an issue where publishers never complete due to a bug in handling reentrant calls. Care to retest the issue against |
Is there a bom ton instal this version? |
Typically, you specify the version number in your build config. See https://github.com/pgjdbc/r2dbc-postgresql/tree/0.8.x#maven-configuration for a Maven example. |
FYI, there are challenges with this scenario due to the way postgres handles transactions. No error message is emitted if you commit transaction in an error state. Instead Postgres responds to commit with rollback. There is a thread https://www.postgresql.org/message-id/b9fb50dc-0f6e-15fb-6555-8ddb86f4aa71%40postgresfriends.org feel free to voice your opinion. The jdbc driver now checks for rollback as a response to commit and throws and exception if this happens |
I have try with the 0.8.4 version, but now some request are not executed. I will retry later. |
We're going to fix in 0.8.x the issue that |
Failed transactions are now properly cleaned up when calling commitTransaction(). Previously, failed transactions were left untouched on commit. This change aligns with PGJDBC's behavior. [resolves #274]
We now throw PostgresqlRollbackException if Postgres silently rolls back a transaction when calling commitTransaction(). https://www.postgresql.org/message-id/b9fb50dc-0f6e-15fb-6555-8ddb86f4aa71%40postgresfriends.org [resolves pgjdbc#274]
We now throw PostgresqlRollbackException if Postgres silently rolls back a transaction when calling commitTransaction(). https://www.postgresql.org/message-id/b9fb50dc-0f6e-15fb-6555-8ddb86f4aa71%40postgresfriends.org [resolves pgjdbc#274]
Bug Report
Versions
Current Behavior
I have a query that fail on commit (due to pk issue). When the commit fail, r2dbc try to perform a rollback.
By following trace
f38d07efa5ddadb6
, we can see that:Later on the log we can see that the connexion has been closed.
and all next requests will fail.
Antoher question, If I fine understand the logs, Multiple transactions are commited/rollback on same time, while I only have one connection configured in my pool.
Steps to reproduce
I have not a simple project to reproduce the issue. I will try to do that.
Expected behavior/code
when commit fail, no rollback should be done.
The text was updated successfully, but these errors were encountered: