Closed kkharji closed 2 years ago
Can you explain what you're trying to achieve? What is the change this PR implements, and why is it useful to you?
Can you explain what you're trying to achieve? What is the change this PR implements, and why is it useful to you?
Sure.
Why?
:duct.database.sql/hikaricp
, creating new connection and taking a bit longer when this isn't the caseChanges made in this PR:
:duct.database.sql/hikaricp
is initialized, halted, suspended and resumed.:duct.database.sql/hikaricp
when URI changes (not quite sure if other values should be accounted for)Not sure if in production logging database uri will be security risk though :D what do u think?
It looks like this is two changes then: one to add logging, and one to add a resume mechanic. This should ideally be two PRs, as each PR should address only one change.
The logger should be attached to the boundary if we want to use it again, rather than using an atom.
The logs should not include the URI for exactly the reason you mention (security).
What bug did you encounter that would have been made more solvable if you had these logs? Why choose :report
as the logging level instead of :debug
?
How much time does the resume mechanic save? If it's short enough not to be noticeable by humans, then it's better to go with the more reliable option of halting and restarting.
How much time does the resume mechanic save? If it's short enough not to be noticeable by humans, then it's better to go with the more reliable option of halting and restarting.
Yah, I haven't yet measured that. Not sure how I'd start? time
function sufficient?. However, regardless of performance gain, isn't a good thing to try minimize the number of call external api methods that might not be "totally pure"?
However, regardless of performance gain, isn't a good thing to try minimize the number of call external api methods that might not be "totally pure"?
No, because it adds uncertainty into the system. Ideally we want no difference between production and development environments, because then we can be more certain that if it works in development it works in production. In practice we can compromise for services that are problematic or costly to restart - the question is whether this service falls into that category.
Hey @weavejester this a quick PR that adds logging to state changes and it is very important in debugging.
Thanks