[PDB-3541] Fix shutdown hang on on flush-and-exit (at least for db ver check) Created: 2017/05/31 Updated: 2018/08/24 Resolved: 2017/06/06
|Fix Version/s:||PDB 4.4.1, PDB 5.0.0|
|Reporter:||Rob Browning||Assignee:||Rob Browning|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
|Epic Link:||Puppet 5 PDB Grab Bag|
|Release Notes:||Bug Fix|
|Release Notes Summary:|| (Might belong alongside the documentation of the postgresql 9.6 requirement.)
PuppetDB should now shut down with a non-zero exit status when it detects an unsupported PostgreSQL version. Previously it might hang while trying to exit.
|QA Risk Assessment:||Needs Assessment|
I haven't tracked down the hang yet, but I at the moment, I suspect it's because we're not calling close on the pdb service. I need to go double-check just how System/exit interacts with daemon and non-daemon threads.
As a "cleaner" alternative, I've also tried using tk's request-shutdown, and that seems promising, but it causes new exceptions when close fails on unexpected nils. We might want to use tk's shutdown-on-error. It'll produce an unwanted backtrace, but might be the only way to shutdown "normally" for now with a non-zero exit status.