[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

Status: Closed
Project: PuppetDB
Component/s: None
Affects Version/s: None
Fix Version/s: PDB 4.4.1, PDB 5.0.0

Type: Bug Priority: Normal
Reporter: Rob Browning Assignee: Rob Browning
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Epic Link: Puppet 5 PDB Grab Bag
Team: Data Platform
Story Points: 2
Sprint: Hopper/Triage
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

 Description   

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.


Generated at Wed Jul 17 05:32:01 PDT 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.