Closed oschwald closed 5 years ago
So I'm thinking a simple fix like this might help 81b518137a08a0db9bfbd1ceb0179b474e06afca
Cannot think of a way to write a test for this at the moment, as 'commit' is baked into Postgers and hard to mock.
Now part of version 3.10.0
Currently, if a commit fails, you can end up in a situation where you are inside of a transaction even though
DBD::Pg
believes otherwise. This is becauseDBicf_AutoCommit
is set to1
andDBIcf_BegunWork
is set to0
before the commit is even executed:https://github.com/bucardo/dbdpg/blob/3f277a5993ed339c604140e814811a67ecbdb79f/dbdimp.c#L593-L603 This has happened to us several times in production when doing something like:
If the timeout happens during the commit, you may end up in this invalid state.