[PDB-1348] PR (1324): (maint) Clean up BoneCP resources when finished - rbrw Created: 2015/03/26  Updated: 2015/07/10  Resolved: 2015/04/10

Status: Closed
Project: PuppetDB
Component/s: None
Affects Version/s: None
Fix Version/s: PDB 3.0.0

Type: Task Priority: Normal
Reporter: gepetto-bot Assignee: Rob Browning
Resolution: Fixed Votes: 0
Labels: github
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Story Points: 0
Sprint: PuppetDB 2015-04-08, PuppetDB 2015-04-22

 Description   

(maint) Clean up BoneCP resources when finished

Pull Request Description


Close the BoneCPDataSource when finished, freeing its threads (among
possibly other things). Doing so substantially decreases the active
thread count at for the end of "lein test", which can be demonstrated by
adding this to the top of a test file before a run:

(defmethod report :begin-test-var [m]
(binding [*out* *err*]
(prn (:var m) :active-threads (Thread/activeCount))))

These changes should also affect normal invocations of "services -c ...".

src/puppetlabs/puppetdb/cli/services.clj | 28 ++++++++++++++--------------
test/puppetlabs/puppetdb/http/facts_test.clj | 3 ++-
2 files changed, 16 insertions, 15 deletions


(webhooks-id: 57868cafae2f052f35c145307ab1c977)



 Comments   
Comment by gepetto-bot [ 2015/03/26 ]

pljenkinsro commented:

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/931/

Comment by gepetto-bot [ 2015/03/27 ]

wkalt commented:

@rlb I'm not sure what I should be doing to verify the change. Could you expand on the demonstration part?

Comment by gepetto-bot [ 2015/03/30 ]

rbrw commented:

@wkalt good point - so an easy way to see the issue is to connect to the "lein test" subprocess with visualvm and look at the bonecp "live threads" at the end of a run. Alternately, you can add this to one of the test files, and compare the final active-threads values on the console:

```
(defmethod report :begin-test-var [m]
(binding [*out* *err*]
(prn (:var m) :active-threads (Thread/activeCount))))
```

Comment by gepetto-bot [ 2015/03/30 ]

wkalt commented:

confirmed that this works with VisualVM

Comment by gepetto-bot [ 2015/04/02 ]

pljenkinsro commented:

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/989/

Comment by gepetto-bot [ 2015/04/02 ]

pljenkinsro commented:

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/990/

Comment by gepetto-bot [ 2015/04/02 ]

wkalt commented:

I'm +1 on this.

Comment by gepetto-bot [ 2015/04/06 ]

wkalt commented:

@rbrw looks like this needs a rebase now

Comment by gepetto-bot [ 2015/04/06 ]

rbrw commented:

@wkalt rebased.

Comment by gepetto-bot [ 2015/04/06 ]

pljenkinsro commented:

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/1012/

Comment by gepetto-bot [ 2015/04/07 ]

rbrw commented:

@pljenkinsro retest this please.

Comment by gepetto-bot [ 2015/04/07 ]

pljenkinsro commented:

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/1015/

Comment by gepetto-bot [ 2015/04/07 ]

pljenkinsro commented:

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/1019/

Comment by gepetto-bot [ 2015/04/08 ]

wkalt commented:

+1

Comment by gepetto-bot [ 2015/04/08 ]

Pull request (maint) Clean up BoneCP resources when finished has been closed.

Generated at Mon Sep 23 12:34:36 PDT 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.