Increase stability by exposing DB connection and pool properties #324
Increase stability by exposing DB connection and pool properties #324kentbull wants to merge 1 commit intohyperledger:mainfrom
Conversation
jkneubuh
left a comment
There was a problem hiding this comment.
Hi @kentbull , thanks for the submission. This seems like a really nice feature and well worth advancing. A couple of issues / questions:
-
The unit tests / validation tests are failing with the new interfaces, it looks like they are missing from some test mock APIs. Please could you make a pass at the tests, as there may be some lingering issues uncovered by the tests.
-
The behavior for default should not be to set the values as they are encoded in caconfig.go, but to omit the call to the SetXYZ method if the attribute is not specified in the input configuration. I.e... leave the behavior "as is," unless the config author has explicitly requested an override of the property.
|
Yes, I'll take another pass at the tests. I thought I got them all working, though I must have missed something. And I agree, the default should be to leave the behavior "as is" unless the config author specifies desired properties. I appreciate your input! I look forward to advancing this. |
Type of change
Description
Exposed database connection properties so we can have automatic connection recycling in production for when connection pools go stale like when Google Cloud SQL does database maintenance about every quarter, sometimes more.
Additional details
Similar to the
maxLifetimeconfiguration property in the HikariCP database library, as well as others, providing access to these connection properties adds significant production stability by enabling connection pools to continually refresh themselves. Given that PostgreSQL connections don't garbage collect objects in SQL connections this configurability of connection pools is a requirement for long-term stability of the CA.Related issues
#321
Release Note
Exposes operational database connection properties for ease of CA administration and stability.