FHIR
FHIR copied to clipboard
Should rollback not commit after healthcheck connection error
Describe the bug
If the $healthcheck
operation encounters an invalid connection, we still end up attempting to commit the transaction instead of rolling back. We need a mechanism to trigger a rollback for certain OperationOutcomes.
Environment Which version of IBM FHIR Server? 5.0.0-RC2
To Reproduce Steps to reproduce the behavior:
- See details here: https://github.com/OpenLiberty/open-liberty/issues/20599
Expected behavior
Transactions should be rolled back not committed when an invalid connection is identified in the $healthcheck
operation.
Additional context This issue was identified by the Open Liberty team responding to https://github.com/OpenLiberty/open-liberty/issues/20599.
It's unclear at the moment if this is having any functional impact, so might just be better practice.
Maybe we can change our numConnectionsPerThreadLocal
setting from 0 to 1 or 2 after addressing this?!
After upgrading to liberty 22.0.0.10 (https://github.com/LinuxForHealth/FHIR/pull/4018) issue https://github.com/OpenLiberty/open-liberty/issues/20599 is fixed. We are not seeing invalid connections being returned by the connection pool to the application. Also scanned through the HealthcheckOperation code and we are doing a rollback when the connection is not valid. Refer else block of FHIRPersistenceJDBCImpl.getHealth() method and HealthcheckOperation.checkOperationOutcome() methods.