View Issue Details

IDProjectCategoryView StatusLast Update
0005281Talermerchant backendpublic2024-01-12 13:04
ReporterFlorian Dold Assigned ToChristian Grothoff Resolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicator 
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Versiongit (master) 
Target Version0.5Fixed in Version0.5 
Summary0005281: before handling a request, we should check if we are running in an un-commited transaction
DescriptionCurrently it is very hard to notice when we forgot to commit/abort a transaction. It can lead to weird results, like a constraint violation when we then "accidentally" abort previous inserts in a soft-failure retry.

Instead every request should first check if we are running inside a transaction, and if that's the case, commit it (or abort??) and log an error.
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

Christian Grothoff

2018-03-04 00:02

manager   ~0012877

Well, I've checked, and the only way to _check_ whether we are in an uncommitted transaction seems to be to either try to COMMIT or ROLLBACK it. I am not sure which one is better...

Christian Grothoff

2018-03-12 10:47

manager   ~0012881

While the psql tool somehow can indicate on COMMIT that no transaction is pending, the libpq API doesn't seem to disclose that state to me (these transactions _always_ succeed, even without START). So I've added some explicit logic inside our code to track START/COMMIT/ROLLBACK events. This is not quite as certain to catch the un-COMMITed transactions as asking psql might be, but it is more efficient *and* should catch all but the most blatant violations of the overall design.

Christian Grothoff

2018-03-12 11:30

manager   ~0012882

Fixed now (last commit to merchant: 5f64092..9b56f3e).

Christian Grothoff

2021-09-02 16:14

manager   ~0018284

Fix committed to master branch.

Issue History

Date ModifiedUsernameFieldChange
2018-02-20 12:10Florian DoldNew Issue
2018-02-20 12:10Florian DoldStatusnew => assigned
2018-02-20 12:10Florian DoldAssigned To => Christian Grothoff
2018-03-04 00:02Christian GrothoffNote Added: 0012877
2018-03-12 10:47Christian GrothoffNote Added: 0012881
2018-03-12 11:30Christian GrothoffNote Added: 0012882
2018-03-12 11:30Christian GrothoffStatusassigned => informing
2018-03-12 11:30Christian GrothoffResolutionopen => fixed
2018-03-12 11:30Christian GrothoffFixed in Version => 0.5
2018-03-12 11:30Christian GrothoffTarget Version0.6 => 0.5
2018-04-15 18:33Christian GrothoffStatusinforming => closed
2021-09-02 16:13Christian Grothoff
2021-09-02 16:14Christian GrothoffNote Added: 0018284
2024-01-12 13:04Christian GrothoffCategorymerchant backend API (C) => mechant backend
2025-03-22 13:09Christian GrothoffCategorymechant backend => merchant backend