FHIR icon indicating copy to clipboard operation
FHIR copied to clipboard

Should rollback not commit after healthcheck connection error

Open punktilious opened this issue 2 years ago • 1 comments

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:

  1. 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.

punktilious avatar Sep 03 '22 07:09 punktilious

Maybe we can change our numConnectionsPerThreadLocal setting from 0 to 1 or 2 after addressing this?!

lmsurpre avatar Sep 16 '22 13:09 lmsurpre

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.

PrasannaHegde1 avatar Oct 25 '22 06:10 PrasannaHegde1