The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Feature #3946

providers should have a finalize class method

Added by Dan Bode almost 4 years ago. Updated 4 months ago.

Status:ClosedStart date:06/06/2010
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:plumbing
Target version:3.4.0
Affected Puppet version:3.2.3 Branch:https://github.com/puppetlabs/puppet/pull/1851
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

For providers that serve as a proxy, it makes sense to open all connections and set up all dependencies in the self.prefetch method. This requires an additional method that is called once per class instance where these connections can be closed. Something like self.finalize (borrowing from Java terminology)

History

#1 Updated by James Turnbull almost 4 years ago

  • Category set to plumbing
  • Status changed from Unreviewed to Needs Decision
  • Assignee set to Luke Kanies

#2 Updated by Luke Kanies almost 4 years ago

  • Status changed from Needs Decision to Accepted
  • Assignee deleted (Luke Kanies)

Not stoked about ‘finalize’, but I think we use it in a couple of other places.

#3 Updated by Ben Hughes about 3 years ago

Good day. Am just checking up on old tickets. Is this one still live, or may it be closed please seeing as it refers to 0.25.x

Cheers.

#4 Updated by Ben Hughes about 3 years ago

  • Status changed from Accepted to Closed

Closed due to inactivity.

#5 Updated by Dan Bode about 3 years ago

I am a little confused about this ticket being closed. It is still a reasonable feature request and has not been implemented. If you want to reject it as something not being targeted that is fine.

#6 Updated by Ben Hughes about 3 years ago

  • Status changed from Closed to Re-opened

I’m happy to reopen it, but if someone could say “yes this still a problem in 2.6.x” then that would be great.

#7 Updated by Dan Bode about 3 years ago

This feature still has not been implemented as of 2.6.x

#8 Updated by James Turnbull over 2 years ago

  • Status changed from Re-opened to Needs Decision
  • Assignee set to Nigel Kersten

#9 Updated by Nigel Kersten over 2 years ago

  • Status changed from Needs Decision to Needs More Information
  • Assignee changed from Nigel Kersten to Dan Bode

I want a little more info about what benefit this brings. Not a huge design document, but more of a concrete sense of what it does for developers/users.

#10 Updated by Dan Bode over 2 years ago

the use case that I was considering is resources that are applied through some kind of web service. (like ec2)

self.instances/self.prefetch give us a pretty clear place to establish a single connection that can be used throughout the catalog application (as opposed to reestablishing a connection for every resource). If we implement this pattern, however, there is no place to handle shutting down the connection.

A more questionable use case may be something like sysctl, where resources are managing a file, but the settings still need to be loaded into memory (I am less certain if this is a valid use case)

#11 Updated by Nigel Kersten over 2 years ago

  • Status changed from Needs More Information to Accepted
  • Assignee deleted (Dan Bode)

I’m not quite seeing the sysctl case, I simply implemented this as a parameter (whether or not you wanted the file settings to be actively loaded into memory) on each setting.

The other is good though. Thanks Dan.

#12 Updated by Trevor Vaughan 9 months ago

  • Affected Puppet version changed from 0.25.4 to 3.2.3

This is still an issue and is now being found by multiple users as time moves on.

Posting this for reference https://groups.google.com/forum/#!topic/puppet-dev/Iqs5jEGfu_0

And yes, I would love to have it too. Right now I’m resorting to horrible hacks by counting resources.

However, the BIGGEST feature that I would like to see is the ability to have two different finalize class methods. One if all parents in the tree succeeded and one if they failed.

#13 Updated by Thomas Linkin 9 months ago

  • Status changed from Accepted to In Topic Branch Pending Review
  • Branch set to https://github.com/puppetlabs/puppet/pull/1800

#14 Updated by Thomas Linkin 9 months ago

  • Status changed from In Topic Branch Pending Review to Code Insufficient
  • Branch deleted (https://github.com/puppetlabs/puppet/pull/1800)

#15 Updated by Eric Badger 8 months ago

  • Status changed from Code Insufficient to In Topic Branch Pending Review
  • Branch set to https://github.com/puppetlabs/puppet/pull/1851

#16 Updated by Adrien Thebo 7 months ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release
  • Target version set to 3.4.0

Merged into master in af5fb2f; this should be released in 3.4.0. With respect to the method name chosen, see https://groups.google.com/forum/#!topic/puppet-dev/2blbxCo5pzg.

#17 Updated by Melissa Stone 4 months ago

  • Status changed from Merged - Pending Release to Closed

Released in Puppet 3.4.0-rc1

#18 Updated by Melissa Stone 4 months ago

Released in Puppet 3.4.0-rc1

#19 Updated by Melissa Stone 4 months ago

Released in Puppet 3.4.0-rc1

#20 Updated by Melissa Stone 4 months ago

Released in Puppet 3.4.0-rc1

#21 Updated by Melissa Stone 4 months ago

Released in Puppet 3.4.0-rc1

#22 Updated by Melissa Stone 4 months ago

Released in Puppet 3.4.0-rc1

Also available in: Atom PDF